Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Matrices as operators

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122993] Matrices as operators
  • From: Chris Young <cy56 at comcast.net>
  • Date: Sun, 20 Nov 2011 05:34:20 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

I'd like to be able to abbreviate matrices such as rotation matrices so 
that I don't have to repeat the argument. This way I can pass in more 
complicated arguments and it also shows the structure of the 
transformation more clearly.

Through[( {
    {Cos, -Sin},
    {Sin, Cos}
   } )[θ]]

will get me partway there:

Out: {{Cos, -Sin}[θ], {Sin, Cos}[θ]}

I have to apply Thread and Through again to finally get what I want:

In: Thread[Through[{{Cos, -Sin}[θ], {Sin, Cos}[θ]}]]

Out: {{Cos[θ], (-Sin)[θ]}, {Sin[θ], Cos[θ]}}

Is there a shortcut way to do this all in one step?

Thanks very much for any help.

Chris Young
cy56 at comcast.net






  • Prev by Date: Re: EmpiricalDistribution bug
  • Next by Date: Re: Problem displaying user-created .cdf files
  • Previous by thread: Re: Timing graphics in the real world
  • Next by thread: Re: Matrices as operators