Rotation Matrices

Definition of rotation matrices

  • rotmat.R1() ... 3D rotation matrix for rotation about the 1-axis
  • rotmat.R2() ... 3D rotation matrix for rotation about the 2-axis
  • rotmat.R3() ... 3D rotation matrix for rotation about the 3-axis

Conversion Routines

Symbolic matrices

For example, you can e.g. generate a Fick-matrix, with

R_Fick = R3_s() * R2_s() * R1_s()

Details

Routines for working with rotation matrices

rotmat.R1(psi)[source]

Rotation about the 1-axis. The argument is entered in degree.

Parameters:psi : rotation angle about the 1-axis [deg]
Returns:R1 : rotation matrix, for rotation about the 1-axis
rotmat.R1_s()[source]

Symbolic rotation matrix about the 1-axis, by an angle psi

You can e.g. generate a Fick-matrix, with R_Fick = R3_s() * R2_s() * R1_s()

rotmat.R2(phi)[source]

Rotation about the 2-axis. The argument is entered in degree.

Parameters:phi : rotation angle about the 1-axis [deg]
Returns:R2 : rotation matrix, for rotation about the 2-axis
rotmat.R2_s()[source]

Symbolic rotation matrix about the 2-axis, by an angle phi

You can e.g. generate a Fick-matrix, with R_Fick = R3_s() * R2_s() * R1_s()

rotmat.R3(theta)[source]

Rotation about the 3-axis. The argument is entered in degree.

Parameters:theta : rotation angle about the 1-axis [deg]
Returns:R3 : rotation matrix, for rotation about the 3-axis
rotmat.R3_s()[source]

Symbolic rotation matrix about the 3-axis, by an angle theta

You can e.g. generate a Fick-matrix, with R_Fick = R3_s() * R2_s() * R1_s()

rotmat.rotmat2Fick(R)[source]

This function takes a rotation matrix, and calculates the corresponding Fick-angles.

Parameters:

R : rotation matrix

Returns:

psi : torsional position (rotation about 1-axis)

phi : vertical position (rotation about 2-axis)

theta : horizontal position (rotation about 3-axis)

Notes

The following formulas are used:

phi = -asin(R31); theta = asin(R21/cos(phi)); psi = asin(R32/cos(phi));

R_31 = n(1)*n(3) - n(2)*sin(rho) - n(1)*n(3)*cos(rho); R_21 = n(1)*n(2) + n(3)*sin(rho) - n(1)*n(2)*cos(rho); R_32 = n(2)*n(3) + n(1)*sin(rho) - n(2)*n(3)*cos(rho);

Note that it is assumed that psi < pi;

rotmat.rotmat2Helmholtz(R)[source]

This function takes a rotation matrix, and calculates the corresponding Helmholtz-angles.

Parameters:

R : rotation matrix

Returns:

psi : torsional position (rotation about 1-axis)

phi : vertical position (rotation about 2-axis)

theta : horizontal position (rotation about 3-axis)

Notes

The following forulas are used:

theta = asin(R21); phi = -asin(R31/cos(theta)); psi = -asin(R23/cos(theta));

R_21 = n(1)*n(2) + n(3)*sin(rho) - n(1)*n(2)*cos(rho); R_31 = n(1)*n(3) - n(2)*sin(rho) - n(1)*n(3)*cos(rho); R_23 = n(2)*n(3) - n(1)*sin(rho) - n(2)*n(3)*cos(rho);

Note that it is assumed that psi < pi;

Table Of Contents

Previous topic

Quaternions

Next topic

Fits

This Page