Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6572

Re: Matrices as operators

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Matrices as operators
Date 2011-11-21 09:25 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jad5dl$e9n$1@smc.vnet.net> (permalink)
References <201111201034.FAA01071@smc.vnet.net>

Show all headers | View raw


Define a function

rMatrix = {{Cos[#], -Sin[#]}, {Sin[#], Cos[#]}} &;

rMatrix[t]

{{Cos[t], -Sin[t]}, {Sin[t], Cos[t]}}

or just use the built-in function

RotationMatrix[t]

{{Cos[t], -Sin[t]}, {Sin[t], Cos[t]}}

% == %%

True


Bob Hanlon


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Matrices as operators Bob Hanlon <hanlonr357@gmail.com> - 2011-11-21 09:25 +0000

csiph-web