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
Euler
structure, when converting to and from other structures, likeQuaternion
andMatrix
.This function does not return the
DEFAULT
enumeration 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
Euler
using 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
Euler
using the angles and order of anotherEuler
.If the
Euler
src
isNone
, 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
Euler
using the given rotation matrix.If the
Matrix
m
isNone
, theEuler
will 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
Euler
using the given normalized quaternion.If the
Quaternion
q
isNone
, theEuler
will be initialized with all angles set to 0.Added in version 1.2.
- Parameters:
q – a normalized
Quaternion
order – the order used to apply the rotations
- init_from_radians(x: float, y: float, z: float, order: EulerOrder) Euler #
Initializes a
Euler
using 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
Euler
using the angles contained in aVec3
.If the
Vec3
v
isNone
, theEuler
will be initialized with all angles set to 0.Added in version 1.2.
- Parameters:
v – a
Vec3
containing 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
Euler
with 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
Euler
usingorder
.This function is equivalent to creating a
Quaternion
from the givenEuler
, and then converting the quaternion into anotherEuler
.Added in version 1.2.
- Parameters:
order – the new order
- to_matrix() Matrix #
Converts a
Euler
into 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 initializee
isXYZ
:- 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
Euler
into aQuaternion
.Added in version 1.10.