Skip to content
Shapemetry

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.

FunctionReturnsDescriptionArgTypeMeaning
Quaternion.fromAxisAngle(axis, angleDeg)quaternionUnit quaternion for a rotation about an axis.axisvectorrotation axis (any magnitude)
angleDeganglerotation angle, degrees
Quaternion.fromEuler(yaw, pitch, roll)quaternionEuler XYZ rotation in degrees (yaw=Z, pitch=Y, roll=X) — the geometry kernel's own XYZ Euler convention.yawnumberrotation about Z in degrees
pitchnumberrotation about Y in degrees
rollnumberrotation about X in degrees
Quaternion.identity()quaternionIdentity rotation [0,0,0,1] — rest pose with no rotation.
Quaternion.multiply(a, b)quaternionHamilton product: multiply(a,b) applies b first, then a.aquaternionapplied second
bquaternionapplied first
Quaternion.rotate(q, point)pointRotate a point about the origin by the quaternion.qquaternionthe rotation
pointpointthe point (rotated about the origin — a quaternion has no translation)
Quaternion.slerp(a, b, t)quaternionSpherical linear interpolation, shortest path.aquaternionstart (t=0)
bquaternionend (t=1)
tnumber0..1 interpolation factor
Quaternion.toAxisAngle(q)axisAngleDecompose a quaternion back to axis + angle (degrees) — the inverse of fromAxisAngle.qquaternionthe rotation
Quaternion.toEuler(q)objectDecompose a quaternion to { yaw, pitch, roll } in degrees — the inverse of fromEuler.qquaternionthe rotation
Last updated: 📖 1 min readEdit on GitHub