Calculating with Rotations edit page

Rotating Vectors

Let

o = rotation.byEuler(90*degree,90*degree,0*degree)
o = rotation
 
  Bunge Euler angles in degree
  phi1  Phi phi2
    90   90    0

a certain rotation. Then the rotation of the xvector is computed via

v = o * xvector
v = vector3d
  x y z
  0 1 0

The inverse rotation is computed via the backslash operator

o \ v
ans = vector3d
  x y z
  1 0 0

Concatenating Rotations

Let

rot1 = rotation.byEuler(90*degree,0,0);
rot2 = rotation.byEuler(0,60*degree,0);

be two rotations. Then the rotation defined by applying first rotation one and then rotation two is computed by

rot = rot2 * rot1
rot = rotation
 
  Bunge Euler angles in degree
  phi1  Phi phi2
     0   60   90

Rotational angle and the rotational axis

Then rotational angle and the axis of rotation can be computed via then commands angle(rot) and axis(rot)

rot.angle / degree

rot.axis
ans =
  104.4775
 
ans = vector3d
         x         y         z
  0.447214 -0.447214  0.774597

If two rotations are specifies the command angle(rot1,rot2) computes the rotational angle between both rotations

angle(rot1,rot2) / degree
ans =
  104.4775

The inverse Rotation

The inverse rotation you get from the command inv(rot)

inv(rot)
ans = rotation
 
  Bunge Euler angles in degree
  phi1  Phi phi2
    90   60  180

Conversion into Euler Angles and Rodrigues Parametrisation

There are methods to transform rotations in almost any other parameterization of rotations as they are:

[alpha,beta,gamma] = Euler(rot,'Matthies')
alpha =
    4.7124
beta =
    1.0472
gamma =
    3.1416