/mat
4x4 floating-point matrix math (Mat4) for 3D transforms, projections, rotations, and inversions.
Functions & symbols#
*#
Matrix multiplication (4x4 * 4x1) = 4x1
| Parameter | Type | Optional | Description |
|---|---|---|---|
m | Mat4 | required | — |
v | (Array Any) | required | — |
AnyMat4#
Constructs a 4x4 matrix from 4 row vectors `[r1 r2 r3 r4]`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
r1 | Any | required | — |
r2 | Any | required | — |
r3 | Any | required | — |
r4 | Any | required | — |
AnyMat4-one#
Constructs the 4x4 identity matrix.
| Parameter | Type | Optional | Description |
|---|---|---|---|
angle | Any | required | — |
AnyMat4-projection#
Constructs a symmetric 4x4 perspective projection matrix (`fov` in radians, `aspect`, `near`, `far`).
| Parameter | Type | Optional | Description |
|---|---|---|---|
fov | Any | required | — |
aspect | Any | required | — |
near | Any | required | — |
far | Any | required | — |
AnyMat4-rotation-x#
Constructs a 4x4 X-axis rotation matrix for `angle` in radians.
| Parameter | Type | Optional | Description |
|---|---|---|---|
angle | Any | required | — |
AnyMat4-rotation-y#
Constructs a 4x4 Y-axis rotation matrix for `angle` in radians.
| Parameter | Type | Optional | Description |
|---|---|---|---|
angle | Any | required | — |
AnyMat4-rotation-z#
Constructs a 4x4 Z-axis rotation matrix for `angle` in radians.
| Parameter | Type | Optional | Description |
|---|---|---|---|
angle | Any | required | — |
AnyMat4-translation#
Constructs a 4x4 translation matrix shifting by `(tx, ty, tz)`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
tx | Any | required | — |
ty | Any | required | — |
tz | Any | required | — |
AnyMat4-zero#
Constructs the 4x4 zero matrix.
| Parameter | Type | Optional | Description |
|---|---|---|---|
angle | Any | required | — |
Anyput#
Sets the scalar entry at row `i`, column `j` of matrix `m` to `value` in place.
| Parameter | Type | Optional | Description |
|---|---|---|---|
m | Mat4 | required | — |
i | Int | required | — |
j | Int | required | — |
value | Float | required | — |
Any