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


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

Re: Matrices as operators

From "David Park" <djmpark@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Matrices as operators
Date 2011-11-21 09:31 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jad5p7$egj$1@smc.vnet.net> (permalink)
References <20684718.1421.1321782772955.JavaMail.root@m06>

Show all headers | View raw


In this case there is a simple answer. Just use RotationMatrix.

RotationMatrix[t]

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

But if you had an operator that wasn't built in, then Presentations has a
routine, PushOnto, that will push arguments onto specific forms and is much
more convenient than Through.

<< Presentations`

{{Cos, -Sin}, {Sin, Cos}}[t];
% // PushOnto[ {Sin, Cos}]

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


David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/ 



From: Chris Young [mailto:cy56@comcast.net]


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
cy56@comcast.net




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


Thread

Re: Matrices as operators "David Park" <djmpark@comcast.net> - 2011-11-21 09:31 +0000

csiph-web