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

class Euler
classmethod alloc() Euler

Allocates a new Euler.

The contents of the returned structure are undefined.

Added in version 1.2.

Methods

class Euler
equal(b: Euler) bool

Checks if two Euler are equal.

Added in version 1.2.

Parameters:

b – a Euler

free() None

Frees the resources allocated by alloc().

Added in version 1.2.

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, like Quaternion and Matrix.

This function does not return the DEFAULT enumeration value; it will return the effective order of rotation instead.

Added in version 1.2.

get_x() float

Retrieves the rotation angle on the X axis, in degrees.

Added in version 1.2.

get_y() float

Retrieves the rotation angle on the Y axis, in degrees.

Added in version 1.2.

get_z() float

Retrieves the rotation angle on the Z axis, in degrees.

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 another Euler.

If the Euler src is None, this function is equivalent to calling init() 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 is None, the Euler 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 is None, the Euler 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 a Vec3.

If the Vec3 v is None, the Euler will be initialized with all angles set to 0.

Added in version 1.2.

Parameters:
  • v – a Vec3 containing the rotation angles in degrees

  • order – 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 and order.

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 using order.

This function is equivalent to creating a Quaternion from the given Euler, and then converting the quaternion into another Euler.

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 initialize e is XYZ:

  • 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 a Quaternion.

Added in version 1.10.

to_vec3() Vec3

Retrieves the angles of a Euler and initializes a Vec3 with them.

Added in version 1.2.

Fields

class Euler
angles
order