matrix_from_axis_angle_vector

compas.geometry.matrix_from_axis_angle_vector(axis_angle_vector, point=[0, 0, 0])[source]

Calculates a rotation matrix from an axis-angle vector.

Parameters
  • axis_angle_vector (list of float) – Three numbers that represent the axis of rotation and angle of rotation through the vector’s magnitude.

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

Returns

list of list of float – The 4x4 transformation matrix representing a rotation.

Examples

>>> aav1 = [-0.043, -0.254, 0.617]
>>> R = matrix_from_axis_angle_vector(aav1)
>>> aav2 = axis_angle_vector_from_matrix(R)
>>> allclose(aav1, aav2)
True