Graphene.Euler

Fields

Name

Type

Access

Description

angles

Graphene.Vec3

r

order

Graphene.EulerOrder

r

Methods

class

alloc ()

equal (b)

free ()

get_alpha ()

get_beta ()

get_gamma ()

get_order ()

get_x ()

get_y ()

get_z ()

init (x, y, z)

init_from_euler (src)

init_from_matrix (m, order)

init_from_quaternion (q, order)

init_from_radians (x, y, z, order)

init_from_vec3 (v, order)

init_with_order (x, y, z, order)

reorder (order)

to_matrix ()

to_quaternion ()

to_vec3 ()

Details

class Graphene.Euler

Describe a rotation using Euler angles.

The contents of the Graphene.Euler structure are private and should never be accessed directly.

New in version 1.2.

classmethod alloc()
Returns:

the newly allocated Graphene.Euler

Return type:

Graphene.Euler

Allocates a new Graphene.Euler.

The contents of the returned structure are undefined.

New in version 1.2.

equal(b)
Parameters:

b (Graphene.Euler) – a Graphene.Euler

Returns:

true if the two Graphene.Euler are equal

Return type:

bool

Checks if two Graphene.Euler are equal.

New in version 1.2.

free()

Frees the resources allocated by Graphene.Euler.alloc().

New in version 1.2.

get_alpha()
Returns:

the first component of the Euler angle vector, in radians

Return type:

float

Retrieves the first component of the Euler angle vector, depending on the order of rotation.

See also: Graphene.Euler.get_x()

New in version 1.10.

get_beta()
Returns:

the second component of the Euler angle vector, in radians

Return type:

float

Retrieves the second component of the Euler angle vector, depending on the order of rotation.

See also: Graphene.Euler.get_y()

New in version 1.10.

get_gamma()
Returns:

the third component of the Euler angle vector, in radians

Return type:

float

Retrieves the third component of the Euler angle vector, depending on the order of rotation.

See also: Graphene.Euler.get_z()

New in version 1.10.

get_order()
Returns:

the order used to apply the rotations

Return type:

Graphene.EulerOrder

Retrieves the order used to apply the rotations described in the Graphene.Euler structure, when converting to and from other structures, like Graphene.Quaternion and Graphene.Matrix.

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

New in version 1.2.

get_x()
Returns:

the rotation angle

Return type:

float

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

New in version 1.2.

get_y()
Returns:

the rotation angle

Return type:

float

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

New in version 1.2.

get_z()
Returns:

the rotation angle

Return type:

float

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

New in version 1.2.

init(x, y, z)
Parameters:
  • x (float) – rotation angle on the X axis, in degrees

  • y (float) – rotation angle on the Y axis, in degrees

  • z (float) – rotation angle on the Z axis, in degrees

Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler using the given angles.

The order of the rotations is Graphene.EulerOrder.DEFAULT.

New in version 1.2.

init_from_euler(src)
Parameters:

src (Graphene.Euler or None) – a Graphene.Euler

Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler using the angles and order of another Graphene.Euler.

If the Graphene.Euler src is None, this function is equivalent to calling Graphene.Euler.init() with all angles set to 0.

New in version 1.2.

init_from_matrix(m, order)
Parameters:
Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler using the given rotation matrix.

If the Graphene.Matrix m is None, the Graphene.Euler will be initialized with all angles set to 0.

New in version 1.2.

init_from_quaternion(q, order)
Parameters:
Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler using the given normalized quaternion.

If the Graphene.Quaternion q is None, the Graphene.Euler will be initialized with all angles set to 0.

New in version 1.2.

init_from_radians(x, y, z, order)
Parameters:
  • x (float) – rotation angle on the X axis, in radians

  • y (float) – rotation angle on the Y axis, in radians

  • z (float) – rotation angle on the Z axis, in radians

  • order (Graphene.EulerOrder) – order of rotations

Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler using the given angles and order of rotation.

New in version 1.10.

init_from_vec3(v, order)
Parameters:
Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler using the angles contained in a Graphene.Vec3.

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

New in version 1.2.

init_with_order(x, y, z, order)
Parameters:
  • x (float) – rotation angle on the X axis, in degrees

  • y (float) – rotation angle on the Y axis, in degrees

  • z (float) – rotation angle on the Z axis, in degrees

  • order (Graphene.EulerOrder) – the order used to apply the rotations

Returns:

the initialized Graphene.Euler

Return type:

Graphene.Euler

Initializes a Graphene.Euler with the given angles and order.

New in version 1.2.

reorder(order)
Parameters:

order (Graphene.EulerOrder) – the new order

Returns:

return location for the reordered Graphene.Euler

Return type:

res: Graphene.Euler

Reorders a Graphene.Euler using order.

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

New in version 1.2.

to_matrix()
Returns:

return location for a Graphene.Matrix

Return type:

res: Graphene.Matrix

Converts a Graphene.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 Graphene.Euler; for instance, if the order used to initialize self is Graphene.EulerOrder.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.

New in version 1.2.

to_quaternion()
Returns:

return location for a Graphene.Quaternion

Return type:

res: Graphene.Quaternion

Converts a Graphene.Euler into a Graphene.Quaternion.

New in version 1.10.

to_vec3()
Returns:

return location for a Graphene.Vec3

Return type:

res: Graphene.Vec3

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

New in version 1.2.