py3dframe.Frame.get_rotation_vector#

Frame.get_rotation_vector(*, convention=None, degrees=False)[source]#

Access the rotation vector representation of the rotation between the parent frame and this frame in a specific convention.

The rotation vector describes the rotation by a single rotation about a fixed axis. The direction of the axis is given by the direction of the vector, and the magnitude of the vector is given by the angle of rotation.

See also

Parameters:
  • convention (Optional[int], optional) – Integer in [0, 7] selecting the convention. Defaults to the frame’s own convention.

  • degrees (bool, optional) – If True, the rotation vector is returned in degrees. Default is False (radians).

Returns:

The rotation vector between the parent frame and this frame in the given convention with shape (3,).

Return type:

numpy.ndarray

Examples

Lets create a frame from its axes and origin with the default convention 0.

import numpy
from py3dframe import Frame

origin = numpy.array([-1, -2, -3])
x_axis = numpy.array([1, 1, 0]) / numpy.sqrt(2)
y_axis = numpy.array([-1, 1, 0]) / numpy.sqrt(2)
z_axis = numpy.array([0, 0, 1])

parent = ... # Define the parent frame if needed, otherwise parent=None to use the canonical frame.

frame = Frame.from_axes(origin=origin, x_axis=x_axis, y_axis=y_axis, z_axis=z_axis, convention=0, parent=parent)

If an application using an other convention required the rotation vector in the convention 4 in degrees, you can access the rotation vector in this convention with the get_rotation_vector() method.

rotation_vector_convention_4 = frame.get_rotation_vector(convention=4, degrees=True)