MAMBO logo MAMBO & the MAMBO Toolbox MAMBO logo

MakeRotations — Generating a rotation matrix [mathematica]

MakeRotations[erms]

MakeRotations[{erms1}, ..., {ermsn}]

MakeRotations[rm]

erms,erms1, ..., ermsn: elementary rotation-matrix specifications

rm: rotation matrix

The function MakeRotations returns a rotation matrix as specified by its arguments.

An elementary rotation-matrix specification comes in one of two forms, namely
phi,i
where phi is an algebraic expression and i equals 1, 2, or 3. This corresponds to a rotation by an angle phi about the i-th basis vector.
phi,v1,v2,v3
where phi, v1, v2, and v3 are algebraic expressions. This corresponds to a rotation by an angle phi about the vector whose coordinates equal v1, v2, and v3.
When invoked with multiple elementary rotation-matrix specifications, the MakeRotations procedure returns the matrix product of the individual rotation matrices specified by each of the elementary rotation-matrix specifications.

MakeRotations[phi,1]

{ { 1 , 0 , 0 } , { 0 , Cos [ phi ] , - Sin [ phi ] } , { 0 , Sin [ phi ] , Cos [ phi ] } }

MakeRotations[{phi,2},{theta,1,1,0}]

{ { Cos [ phi ] ( 1 2 ( 1 - Cos [ theta ] ) + Cos [ theta ] ) - Sin [ phi ] Sin [ theta ] 2 , 1 2 Cos [ phi ] ( 1 - Cos [ theta ] ) + Sin [ phi ] Sin [ theta ] 2 , Cos [ theta ] Sin [ phi ] + Cos [ phi ] Sin [ theta ] 2 } , { 1 2 ( 1 - Cos [ theta ] ) , 1 2 ( 1 - Cos [ theta ] ) + Cos [ theta ] , - Sin [ theta ] 2 } , { - ( 1 2 ( 1 - Cos [ theta ] ) + Cos [ theta ] ) Sin [ phi ] - Cos [ phi ] Sin [ theta ] 2 , - 1 2 ( 1 - Cos [ theta ] ) Sin [ phi ] + Cos [ phi ] Sin [ theta ] 2 , Cos [ phi ] Cos [ theta ] - Sin [ phi ] Sin [ theta ] 2 } }


Toolbox functions