from_axisangle#

DCM.from_axisangle(axis: ndarray, angle: float) ndarray#

DCM from axis-angle representation

Use Rodrigue’s formula to obtain the DCM from the axis-angle representation.

\[\mathbf{R} = \mathbf{I}_3 - (\sin\theta)\mathbf{K} + (1-\cos\theta)\mathbf{K}^2\]

where \(\mathbf{R}\) is the DCM, which rotates through an angle \(\theta\) counterclockwise about the axis \(\mathbf{k}\), \(\mathbf{I}_3\) is the \(3\times 3\) identity matrix, and \(\mathbf{K}\) is the skew-symmetric matrix of \(\mathbf{k}\).

Parameters:
  • axis (numpy.ndarray) – Axis of rotation.

  • angle (float) – Angle of rotation, in radians.

Returns:

R – 3-by-3 direction cosine matrix

Return type:

numpy.ndarray

Examples

>>> R = DCM()
>>> R.view()
DCM([[1., 0., 0.],
     [0., 1., 0.],
     [0., 0., 1.]])
>>> R.from_axisangle([0.81187135, -0.43801381, 0.38601658], 0.6742208510527136)
array([[ 0.92541658, -0.31879578, -0.20487413],
       [ 0.16317591,  0.82317294, -0.54383814],
       [ 0.34202014,  0.46984631,  0.81379768]])