Model - Quaternion functions
Every function callable as Quaternion.* inside an expression — an argument input, a parameter binding, a table cell. Pure: no side effects, no async.
| Function | Returns | Description | Arg | Type | Meaning |
|---|---|---|---|---|---|
Quaternion.fromAxisAngle(axis, angleDeg) | quaternion | Unit quaternion for a rotation about an axis. | axis | vector | rotation axis (any magnitude) |
angleDeg | angle | rotation angle, degrees | |||
Quaternion.fromEuler(yaw, pitch, roll) | quaternion | Euler XYZ rotation in degrees (yaw=Z, pitch=Y, roll=X) — the geometry kernel's own XYZ Euler convention. | yaw | number | rotation about Z in degrees |
pitch | number | rotation about Y in degrees | |||
roll | number | rotation about X in degrees | |||
Quaternion.identity() | quaternion | Identity rotation [0,0,0,1] — rest pose with no rotation. | |||
Quaternion.multiply(a, b) | quaternion | Hamilton product: multiply(a,b) applies b first, then a. | a | quaternion | applied second |
b | quaternion | applied first | |||
Quaternion.rotate(q, point) | point | Rotate a point about the origin by the quaternion. | q | quaternion | the rotation |
point | point | the point (rotated about the origin — a quaternion has no translation) | |||
Quaternion.slerp(a, b, t) | quaternion | Spherical linear interpolation, shortest path. | a | quaternion | start (t=0) |
b | quaternion | end (t=1) | |||
t | number | 0..1 interpolation factor | |||
Quaternion.toAxisAngle(q) | axisAngle | Decompose a quaternion back to axis + angle (degrees) — the inverse of fromAxisAngle. | q | quaternion | the rotation |
Quaternion.toEuler(q) | object | Decompose a quaternion to { yaw, pitch, roll } in degrees — the inverse of fromEuler. | q | quaternion | the rotation |