Rotation.from_axis_and_angle

classmethod Rotation.from_axis_and_angle(axis, angle, point=[0, 0, 0])

Calculates a Rotation from a rotation axis and an angle and an optional point of rotation.

The rotation is based on the right hand rule, i.e. anti-clockwise if the axis of rotation points towards the observer.

Parameters
  • axis (list of float) – Three numbers that represent the axis of rotation.

  • angle (float) – The rotation angle in radians.

  • point (Point or list of float) – A point to perform a rotation around an origin other than [0, 0, 0].

Examples

>>> axis1 = normalize_vector([-0.043, -0.254, 0.617])
>>> angle1 = 0.1
>>> R = Rotation.from_axis_and_angle(axis1, angle1)
>>> axis2, angle2 = R.axis_and_angle
>>> allclose(axis1, axis2)
True
>>> allclose([angle1], [angle2])
True

Notes

The rotation is based on the right hand rule, i.e. anti-clockwise if the axis of rotation points towards the observer.