from_axis_angle#

classmethod Quaternion.from_axis_angle(axis, angle)#

Creates a normalized rotation quaternion from a given axis and rotation angle.

Parameters:
axisList or tuple of float

A 3D vector representing the axis of rotation.

anglefloat

The rotation angle in radians.

Returns:
Quaternion

A unit quaternion representing the rotation around the specified axis by the given angle.

Examples

>>> from ansys.aedt.core.generic.quaternion import Quaternion
>>> from math import pi, sqrt
>>> Quaternion.from_axis_angle((sqrt(3) / 3, sqrt(3) / 3, sqrt(3) / 3), 2 * pi / 3)
Quaternion(0.5, 0.5, 0.5, 0.5)