       Re: Matrices as operators

• To: mathgroup at smc.vnet.net
• Subject: [mg123060] Re: Matrices as operators
• From: Ray Koopman <koopman at sfu.ca>
• Date: Tue, 22 Nov 2011 05:34:28 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <jaal4e\$12d\$1@smc.vnet.net>

```On Nov 20, 2:34 am, Chris Young <c... at comcast.net> wrote:
> 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}
>    } )[=CE=B8]]
>
> will get me partway there:
>
> Out: {{Cos, -Sin}[=CE=B8], {Sin, Cos}[=CE=B8]}
>
> I have to apply Thread and Through again to finally get what I want:
>
> In: Thread[Through[{{Cos, -Sin}[=CE=B8], {Sin, Cos}[=CE=B8]}]]
>
> Out: {{Cos[=CE=B8], (-Sin)[=CE=B8]}, {Sin[=CE=B8], Cos[=CE=B8]}}
>
> Is there a shortcut way to do this all in one step?
>
> Thanks very much for any help.
>
> Chris Young
> c... at comcast.net

If you're worried about redundant calculations when the matrices
are bigger than 2 x 2 and the functions are more complicated than
Sin and Cos, try something like

R[t_] := {{#1,-#2},{#2,#1}}&[Cos@t,Sin@t]

```

• Prev by Date: Re: Elliptical gear calculations
• Next by Date: Re: Is it possible to define new color schemes?
• Previous by thread: Re: Matrices as operators
• Next by thread: Re: Matrices as operators