1.2 <GrapheneEuler>

Structure: <GrapheneEuler>

Describe a rotation using Euler angles.

The contents of the <GrapheneEuler> structure are private and should never be accessed directly.

Procedures

Procedure: euler:alloc ⇒ %return

Allocates a new <GrapheneEuler>.

The contents of the returned structure are undefined.

%return

Returned: a <GrapheneEuler>.

the newly allocated <GrapheneEuler>

Method: euler:equal? self b ⇒ %return
Method: equal? self b ⇒ %return

Checks if two <GrapheneEuler> are equal.

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

b

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a boolean.

true if the two <GrapheneEuler> are equal

Method: euler:free self
Method: free self

Frees the resources allocated by euler:alloc.

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

Method: euler:get-alpha self ⇒ %return
Method: get-alpha self ⇒ %return

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

See also: euler:get-x

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a real number.

the first component of the Euler angle vector, in radians

Method: euler:get-beta self ⇒ %return
Method: get-beta self ⇒ %return

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

See also: euler:get-y

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a real number.

the second component of the Euler angle vector, in radians

Method: euler:get-gamma self ⇒ %return
Method: get-gamma self ⇒ %return

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

See also: euler:get-z

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a real number.

the third component of the Euler angle vector, in radians

Method: euler:get-order self ⇒ %return
Method: get-order self ⇒ %return

Retrieves the order used to apply the rotations described in the <GrapheneEuler> structure, when converting to and from other structures, like <GrapheneQuaternion> and <GrapheneMatrix>.

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

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a <%GrapheneEulerOrder>.

the order used to apply the rotations

Method: euler:get-x self ⇒ %return
Method: get-x self ⇒ %return

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

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a real number.

the rotation angle

Method: euler:get-y self ⇒ %return
Method: get-y self ⇒ %return

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

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a real number.

the rotation angle

Method: euler:get-z self ⇒ %return
Method: get-z self ⇒ %return

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

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

%return

Returned: a real number.

the rotation angle

Method: euler:init self x y z ⇒ %return
Method: init self x y z ⇒ %return

Initializes a <GrapheneEuler> using the given angles.

The order of the rotations is default.

self

Passed: a <GrapheneEuler>.

the <GrapheneEuler> to initialize

x

Passed: a real number.

rotation angle on the X axis, in degrees

y

Passed: a real number.

rotation angle on the Y axis, in degrees

z

Passed: a real number.

rotation angle on the Z axis, in degrees

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:init-from-euler self [src] ⇒ %return
Method: init-from-euler self [src] ⇒ %return

Initializes a <GrapheneEuler> using the angles and order of another <GrapheneEuler>.

If the <GrapheneEuler> src is #f, this function is equivalent to calling euler:init with all angles set to 0.

self

Passed: a <GrapheneEuler>.

the <GrapheneEuler> to initialize

src

Passed, or left out: a <GrapheneEuler>, or #f.

a <GrapheneEuler>

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:init-from-matrix self m order ⇒ %return
Method: init-from-matrix self m order ⇒ %return

Initializes a <GrapheneEuler> using the given rotation matrix.

If the <GrapheneMatrix> m is #f, the <GrapheneEuler> will be initialized with all angles set to 0.

self

Passed: a <GrapheneEuler>.

the <GrapheneEuler> to initialize

m

Passed: a <GrapheneMatrix>, or #f.

a rotation matrix

order

Passed: a <%GrapheneEulerOrder>, or one of its symbols.

the order used to apply the rotations

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:init-from-quaternion self q order ⇒ %return
Method: init-from-quaternion self q order ⇒ %return

Initializes a <GrapheneEuler> using the given normalized quaternion.

If the <GrapheneQuaternion> q is #f, the <GrapheneEuler> will be initialized with all angles set to 0.

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

q

Passed: a <GrapheneQuaternion>, or #f.

a normalized <GrapheneQuaternion>

order

Passed: a <%GrapheneEulerOrder>, or one of its symbols.

the order used to apply the rotations

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:init-from-radians self x y z order ⇒ %return
Method: init-from-radians self x y z order ⇒ %return

Initializes a <GrapheneEuler> using the given angles and order of rotation.

self

Passed: a <GrapheneEuler>.

the <GrapheneEuler> to initialize

x

Passed: a real number.

rotation angle on the X axis, in radians

y

Passed: a real number.

rotation angle on the Y axis, in radians

z

Passed: a real number.

rotation angle on the Z axis, in radians

order

Passed: a <%GrapheneEulerOrder>, or one of its symbols.

order of rotations

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:init-from-vec3 self v order ⇒ %return
Method: init-from-vec3 self v order ⇒ %return

Initializes a <GrapheneEuler> using the angles contained in a <GrapheneVec3>.

If the <GrapheneVec3> v is #f, the <GrapheneEuler> will be initialized with all angles set to 0.

self

Passed: a <GrapheneEuler>.

the <GrapheneEuler> to initialize

v

Passed: a <GrapheneVec3>, or #f.

a <GrapheneVec3> containing the rotation angles in degrees

order

Passed: a <%GrapheneEulerOrder>, or one of its symbols.

the order used to apply the rotations

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:init-with-order self x y z order ⇒ %return
Method: init-with-order self x y z order ⇒ %return

Initializes a <GrapheneEuler> with the given angles and order.

self

Passed: a <GrapheneEuler>.

the <GrapheneEuler> to initialize

x

Passed: a real number.

rotation angle on the X axis, in degrees

y

Passed: a real number.

rotation angle on the Y axis, in degrees

z

Passed: a real number.

rotation angle on the Z axis, in degrees

order

Passed: a <%GrapheneEulerOrder>, or one of its symbols.

the order used to apply the rotations

%return

Returned: a <GrapheneEuler>.

the initialized <GrapheneEuler>

Method: euler:reorder! self order res ⇒ res
Method: reorder! self order res ⇒ res

Reorders a <GrapheneEuler> using order.

This function is equivalent to creating a <GrapheneQuaternion> from the given <GrapheneEuler>, and then converting the quaternion into another <GrapheneEuler>.

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

order

Passed: a <%GrapheneEulerOrder>, or one of its symbols.

the new order

res

Passed, filled in, and returned: a <GrapheneEuler>.

return location for the reordered <GrapheneEuler>

Method: euler:to-matrix! self res ⇒ res
Method: to-matrix! self res ⇒ res

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

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

res

Passed, filled in, and returned: a <GrapheneMatrix>.

return location for a <GrapheneMatrix>

Method: euler:to-quaternion! self res ⇒ res
Method: to-quaternion! self res ⇒ res

Converts a <GrapheneEuler> into a <GrapheneQuaternion>.

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

res

Passed, filled in, and returned: a <GrapheneQuaternion>.

return location for a <GrapheneQuaternion>

Method: euler:to-vec3! self res ⇒ res
Method: to-vec3! self res ⇒ res

Retrieves the angles of a <GrapheneEuler> and initializes a <GrapheneVec3> with them.

self

Passed: a <GrapheneEuler>.

a <GrapheneEuler>

res

Passed, filled in, and returned: a <GrapheneVec3>.

return location for a <GrapheneVec3>