pyvista.Transform.rotation_axis_angle

pyvista.Transform.rotation_axis_angle#

property Transform.rotation_axis_angle: tuple[tuple[float, float, float], float][source]#

Return the rotation component of the current transformation matrix as a vector and angle.

Added in version 0.47.

Examples

Compose a rotation from a vector and angle.

>>> import pyvista as pv
>>> trans = pv.Transform().rotate_vector((1, 2, 3), 30)

Get the rotation axis and angle.

>>> axis, angle = trans.rotation_axis_angle
>>> axis
(0.2672, 0.5345, 0.8017)
>>> angle
30.0

Compose a second rotation around the same axis and get the axis and angle again.

>>> _ = trans.rotate_vector((1, 2, 3), 40)
>>> axis, angle = trans.rotation_axis_angle
>>> axis
(0.2672, 0.5345, 0.8017)
>>> angle
70.0