Re: Rotation3D, MatrixRotation3D ?

*To*: mathgroup at smc.vnet.net*Subject*: [mg30392] Re: Rotation3D, MatrixRotation3D ?*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Wed, 15 Aug 2001 01:03:59 -0400 (EDT)*Organization*: Universitaet Leipzig*References*: <9lalnl$cd3$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

ojg wrote: > > Question regarding rotations. > > Some of the documentation found regarding this is not as far as I can see > complete in the documentation, at least the subject is difficult enough to > make me unsure once not 100% clear:) > > Fist, what are the defined "euler angles" in mathematica, and in what order > are they applied? The order of the Euler angels is fixed by it's definition. You may look at http://www.martinb.com/threed/scenegraph/rotations/euler.htm > > Second, of which side of the vector is the rotational matrix multiplied ? As usual matrix.vector > > Third, is there a mathematica way to rotate around an abitrary rotational > axis? If not, what would the mathematica matix be for this? rotationmatrix[axis_?VectorQ,theta_?NumericQ] := Module[{nx,ny,nz,st,ct,norm}, norm=Sqrt[Dot[axis,axis]]; If[norm<$MachineEpsilon, Return[IndentityMatrix[3]] ]; {nx,ny,nz} = N[axis/norm]; {ct,st}=N[{Cos[theta],Sin[theta]}]; N[{{ nx^2 + (1 - nx^2)*ct,nx*ny*(1 - ct) + nz*st,nx*nz*(1 - ct) - ny*st}, { nx*ny*(1 - ct) - nz*st,ny^2 + (1 - ny^2)*ct,ny*nz*(1 - ct) + nx*st}, { nx*nz*(1 - ct) + ny*st,ny*nz*(1 - ct) - nx*st,nz^2 + (1 - nz^2)*ct}}] ] MathGL3d has the MVRotate3D[] function to do vector/axis rotations. > > My problem to solve is as follows: Given three rotational angles (a,b,c) > applied in order to the following three rotational axes: Y axis, X axis, Z > axis. (usual right hand system). This rotation applied to any vector v will > give you a vector V (first Y rotation applied on v, etc). And for what do you need Euler angles ? > > Now, given a rotational matrix with pure numerical values in, I need to find > the three angles, and I need a general formulae for this solution taking > care of the special cases. This can't exist. Because for an arbitary matrix it will not possible to find a solution. The matrix must be orthogonal R^T R=1. Regards Jens