# `math.mat4`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `math.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Const · `import { mat4 } from '@holostep-configurators/runtime-client/math';` · stable · since 2.0.0 · section 23. /math

4×4 matrices.

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="identity"></a>[`identity`](math.mat4.identity.md) | method | The identity matrix. |
| <a id="compose"></a>[`compose`](math.mat4.compose.md) | method | The matrix of a pose; omitted fields are identity. |
| <a id="decompose"></a>[`decompose`](math.mat4.decompose.md) | method | The pose of a matrix, with one rotation (a quaternion); a mirroring matrix puts its −1 on `scale.x`, and a sheared one decomposes approximately, as [`Pose.scale`](Pose.scale.md) says. |
| <a id="multiply"></a>[`multiply`](math.mat4.multiply.md) | method | a × b: b applies first. |
| <a id="invert"></a>[`invert`](math.mat4.invert.md) | method | The inverse, or null when `m` can't be inverted. |

## Declaration

```ts
export const mat4: {
  identity(): Mat4;
  compose(pose: PoseInput): Mat4;
  decompose(m: Mat4): {
    position: Point3;
    quaternion: Quat;
    scale: Point3;
  };
  multiply(a: Mat4, b: Mat4): Mat4;
  invert(m: Mat4): Mat4 | null;
};
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `mat4` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | not recorded: no ledger row names this member or its owner |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
