1 Rotation Matrices in Three-Dimensional Cartesian Coordinates Instructor: Nam Sun Wang rotate.mcd The three most fundamental Rotation matrices are listed below. We can derive everything else from these three. Rotation about the x-axis: 1 R x ( φ) 0 Rotation about the y-axis: cos( ψ ) 0 sin( ψ ) 0 0 cos( φ) Rotation about the z-axis sin( φ) R y( ψ ) 0 0 sin( φ) cos( φ) 1 0 sin( ψ ) 0 cos( ψ ) cos( θ ) R z( θ ) sin( θ ) 0 sin( θ ) cos( θ ) 0 0 0 1 It matters which way we rotate first. For example, RxRz≠RzRx cos( θ ) R x ( φ) . R z( θ ) sin( θ ) 0 cos( φ) . sin( θ ) cos( φ) . cos( θ ) sin( φ) sin( φ) . sin( θ ) sin( φ) . cos( θ ) cos( φ) cos( θ ) R z( θ ) . R x ( φ) cos( φ) . sin( θ ) sin( φ) . sin( θ ) sin( θ ) cos( φ) . cos( θ ) sin( φ) . cos( θ ) sin( φ) 0 cos( φ) Successive Rotation. For example, rotate about the z axis first followed by rotation about the x-axis results in a vector Rx*Rz*v, where v is the original vector before rotation. We let Mathcad construct the six double rotation matrices with SmartMath, and we copy the results into the expressions below. Notation: Rxz=RxRz R xy( φ, ψ ) cos( ψ ) 0 sin( ψ ) sin( φ) . sin( ψ ) cos( φ) sin( φ) . cos( ψ ) cos( φ) . sin( ψ ) sin( φ) cos( φ) . cos( ψ ) cos( θ ) R xz( φ, θ ) sin( θ ) 0 cos( φ) . sin( θ ) cos( φ) . cos( θ ) sin( φ) sin( φ) . sin( θ ) sin( φ) . cos( θ ) cos( φ) cos( ψ ) sin( φ) . sin( ψ ) cos( φ) . sin( ψ ) R yx( φ, ψ ) cos( φ) 0 sin( φ) sin( ψ ) sin( φ) . cos( ψ ) cos( φ) . cos( ψ ) cos( ψ ) . cos( θ ) R yz( ψ , θ ) cos( ψ ) . sin( θ ) sin( ψ ) sin( θ ) cos( θ ) 0 sin( ψ ) . cos( θ ) sin( ψ ) . sin( θ ) cos( ψ ) ← Commonly used 3-D rotation matrix. cos( θ ) R zx( φ, θ ) 2 sin( φ) . sin( θ ) cos( φ) . sin( θ ) sin( θ ) cos( φ) . cos( θ ) cos( ψ ) . cos( θ ) R zy( ψ , θ ) sin( φ) . cos( θ ) sin( φ) 0 rotate.mcd cos( φ) sin( θ ) sin( ψ ) . cos( θ ) cos( ψ ) . sin( θ ) cos( θ ) sin( ψ ) . sin( θ ) sin( ψ ) cos( ψ ) 0 Check: -R(•) is not reverse rotation or inverse. 1 R x ( φ ) . R x ( φ) 0 0 cos( φ) 0 0 2 sin( φ) 2 2 . cos( φ) . sin( φ) 2 . cos( φ) . sin( φ) cos( φ) 2 sin( φ) 2 Check: Rotation forward followed by rotation backward by the same angle should give Identify. R(-•)=R-1(•) 1 R x ( φ ) . R x ( φ) 0 0 cos( φ) 0 2 0 sin( φ) 2 0 cos( φ) 0 2 sin( φ) 2 Another check on R(-•)=R-1(•): cos( ψ ) R xy( φ, ψ ) . R yx( φ, ψ ) 2 sin( ψ ) 2 0 2 sin( φ) . sin( ψ ) 0 2 sin( φ) . sin( ψ ) . cos( φ) 0 2 cos( φ) 2 2 2 sin( φ) . cos( ψ ) cos( φ) . sin( φ) sin( φ) . sin( 2 sin( φ) . cos( ψ ) . cos( φ) co Copy and paste the RHS: cos( ψ ) 2 sin( ψ ) 2 0 2 sin( φ) . sin( ψ ) 0 0 2 sin( φ) . sin( ψ ) . cos( φ) |Symbolic|Simplify| gives: 1 0 0 0 1 0 0 0 1 Thus, R(•)*R(-•)=1 2 cos( φ) 0 2 2 sin( φ) . cos( ψ ) cos( φ) . sin( φ) 2 2 sin( φ) . cos( ψ ) . cos( φ) 2 sin( φ) . sin( ψ ) . cos( φ) cos( φ) . sin( φ 2 2 cos( φ) . sin( ψ ) sin( φ) 2 3 rotate.mcd Check: Rotation matrices are orthogonal. R(•)*RT(•)=RT(•)*R(•)=1, or equivalently, RT(•)=R-1(•) 1 R x ( φ ) . R x ( φ) T 0 0 cos( φ) 2 0 0 sin( φ) 2 0 cos( φ) 0 2 Copy and paste the RHS: 1 0 cos( φ) 0 sin( φ) 2 cos( φ) 0 2 |Symbolic|Simplify| gives: 0 2 sin( φ) 0 1 0 0 0 0 1 0 2 sin( φ) 2 Thus, R(•)*RT(•)=1 0 0 1 Now, test the converse to see if RT(•)*R(•)=1. 1 T R x ( φ) . R x ( φ) 0 0 cos( φ) 2 0 0 sin( φ) 2 0 cos( φ) 0 Copy and paste the RHS: 1 0 cos( φ) 0 sin( φ) 2 cos( φ) 0 sin( φ) 2 |Symbolic|Simplify| gives: 0 2 2 2 0 1 0 0 0 0 1 0 sin( φ) 2 Thus, RT(•)*R(•)=1 0 0 1 Another check on R xy: cos( ψ ) R xy( φ, ψ ) . R xy( φ, ψ ) T 2 sin( ψ ) 2 0 2 2 sin( φ) . sin( ψ ) 0 2 sin( φ) . sin( ψ ) . cos( φ) 0 cos( φ) 2 2 2 sin( φ) . cos( ψ ) cos( φ) . sin( φ) sin( φ) . si 2 sin( φ) . cos( ψ ) . cos( φ) Copy and paste the RHS: cos( ψ ) 2 sin( ψ ) 2 0 2 sin( φ) . sin( ψ ) 0 0 2 sin( φ) . sin( ψ ) . cos( φ) |Symbolic|Simplify| gives: 1 0 0 0 1 0 0 0 1 2 cos( φ) 0 2 2 sin( φ) . cos( ψ ) cos( φ) . sin( φ) 2 2 sin( φ) . cos( ψ ) . cos( φ) 2 sin( φ) . sin( ψ ) . cos( φ) cos( φ) . sin( 2 2 cos( φ) . sin( ψ ) sin( φ) 2 4 rotate.mcd Check: Rotation Matrices are normalized. R x( θ ) cos( θ ) 2 sin( θ ) 2 which simplifies to unity. Another example: R xz( θ , φ) 2 2 cos( φ) . cos( θ ) 2 2 sin( θ ) . cos( φ) 2 2 sin( φ) . cos( θ ) 2 2 sin( φ) . sin( θ ) Copy and paste the RHS: 2 2 cos( φ) . cos( θ ) 2 2 sin( θ ) . cos( φ) 2 2 sin( φ) . cos( θ ) 2 2 sin( φ) . sin( θ ) |Symbolic|Simplify| gives: 1 We can generate a series of combinations of three successive rotations. The following is one example: cos( ψ ) . cos( θ ) R x ( φ) . R y ( ψ ) . R z( θ ) sin( φ) . sin( ψ ) . cos( θ ) cos( φ) . sin( ψ ) . cos( θ ) cos( φ) . sin( θ ) sin( φ) . sin( ψ ) . cos( θ ) cos( φ) . sin( ψ ) . cos( θ ) sin( ψ ) sin( φ) . sin( ψ ) . sin( θ ) cos( φ) . cos( θ ) sin( φ) . cos( ψ ) sin( φ) . sin( θ ) cos( φ) . sin( ψ ) . sin( θ ) sin( φ) . cos( θ ) cos( φ) . cos( ψ ) cos( θ ) . cos( ψ ) R xyz( φ, ψ , θ ) cos( ψ ) . sin( θ ) cos( φ) . sin( θ ) cos( ψ ) . sin( θ ) sin( ψ ) sin( φ) . sin( ψ ) . sin( θ ) cos( φ) . cos( θ ) sin( φ) . cos( ψ ) sin( φ) . sin( θ ) cos( φ) . sin( ψ ) . sin( θ ) sin( φ) . cos( θ ) cos( φ) . cos( ψ )