Documentation / @interstellar-tools/equations / rot3
Function: rot3()
ts
function rot3(theta: Radians): Matrix3x3Type;Defined in: helpers/rot-3.ts:38
Construct a right-handed rotation matrix about the z-axis (often written R₃).
This returns the 3×3 direction cosine matrix (DCM) for an active rotation by angle theta around the +Z axis:
Notes:
thetais in radians.- Matrix layout is row-major:
M[row][col]. - Common in 3-1-3 / 3-2-1 rotation sequences (e.g., IAU pole + prime meridian rotations) and general 3D coordinate transforms.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | Radians | Rotation angle ( |
Returns
3×3 rotation matrix (
Throws
If theta is not a finite number.
Example
ts
// Rotate about +Z by 90°:
const R = rot3(Math.PI / 2);