Euler#
Added in version 1.2.
- class Euler(*args, **kwargs)#
Describe a rotation using Euler angles.
The contents of the Euler structure are private
and should never be accessed directly.
Constructors#
Methods#
- class Euler
-
- get_alpha() float#
Retrieves the first component of the Euler angle vector, depending on the order of rotation.
See also:
get_x()Added in version 1.10.
- get_beta() float#
Retrieves the second component of the Euler angle vector, depending on the order of rotation.
See also:
get_y()Added in version 1.10.
- get_gamma() float#
Retrieves the third component of the Euler angle vector, depending on the order of rotation.
See also:
get_z()Added in version 1.10.
- get_order() EulerOrder#
Retrieves the order used to apply the rotations described in the
Eulerstructure, when converting to and from other structures, likeQuaternionandMatrix.This function does not return the
DEFAULTenumeration value; it will return the effective order of rotation instead.Added in version 1.2.
- init(x: float, y: float, z: float) Euler#
Initializes a
Eulerusing the given angles.The order of the rotations is
DEFAULT.Added in version 1.2.
- Parameters:
x – rotation angle on the X axis, in degrees
y – rotation angle on the Y axis, in degrees
z – rotation angle on the Z axis, in degrees
- init_from_euler(src: Euler | None = None) Euler#
Initializes a
Eulerusing the angles and order of anotherEuler.If the
EulersrcisNone, this function is equivalent to callinginit()with all angles set to 0.Added in version 1.2.
- Parameters:
src – a
Euler
- init_from_matrix(m: Matrix | None, order: EulerOrder) Euler#
Initializes a
Eulerusing the given rotation matrix.If the
MatrixmisNone, theEulerwill be initialized with all angles set to 0.Added in version 1.2.
- Parameters:
m – a rotation matrix
order – the order used to apply the rotations
- init_from_quaternion(q: Quaternion | None, order: EulerOrder) Euler#
Initializes a
Eulerusing the given normalized quaternion.If the
QuaternionqisNone, theEulerwill be initialized with all angles set to 0.Added in version 1.2.
- Parameters:
q – a normalized
Quaternionorder – the order used to apply the rotations
- init_from_radians(x: float, y: float, z: float, order: EulerOrder) Euler#
Initializes a
Eulerusing the given angles and order of rotation.Added in version 1.10.
- Parameters:
x – rotation angle on the X axis, in radians
y – rotation angle on the Y axis, in radians
z – rotation angle on the Z axis, in radians
order – order of rotations
- init_from_vec3(v: Vec3 | None, order: EulerOrder) Euler#
Initializes a
Eulerusing the angles contained in aVec3.If the
Vec3visNone, theEulerwill be initialized with all angles set to 0.Added in version 1.2.
- Parameters:
v – a
Vec3containing the rotation angles in degreesorder – the order used to apply the rotations
- init_with_order(x: float, y: float, z: float, order: EulerOrder) Euler#
Initializes a
Eulerwith the given angles andorder.Added in version 1.2.
- Parameters:
x – rotation angle on the X axis, in degrees
y – rotation angle on the Y axis, in degrees
z – rotation angle on the Z axis, in degrees
order – the order used to apply the rotations
- reorder(order: EulerOrder) Euler#
Reorders a
Eulerusingorder.This function is equivalent to creating a
Quaternionfrom the givenEuler, and then converting the quaternion into anotherEuler.Added in version 1.2.
- Parameters:
order – the new order
- to_matrix() Matrix#
Converts a
Eulerinto a transformation matrix expressing the extrinsic composition of rotations described by the Euler angles.The rotations are applied over the reference frame axes in the order associated with the
Euler; for instance, if the order used to initializeeisXYZ:- the first rotation moves the body around the X axis with
an angle φ
- the second rotation moves the body around the Y axis with
an angle of ϑ
- the third rotation moves the body around the Z axis with
an angle of ψ
The rotation sign convention is right-handed, to preserve compatibility between Euler-based, quaternion-based, and angle-axis-based rotations.
Added in version 1.2.
- to_quaternion() Quaternion#
Converts a
Eulerinto aQuaternion.Added in version 1.10.