# `math.vec3`

> 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 { vec3 } from '@holostep-configurators/runtime-client/math';` · stable · since 2.0.0 · section 23. /math

3D vectors and points.

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="add"></a>[`add`](math.vec3.add.md) | method | a + b. |
| <a id="sub"></a>[`sub`](math.vec3.sub.md) | method | a − b. |
| <a id="scale"></a>[`scale`](math.vec3.scale.md) | method | a × s. |
| <a id="dot"></a>[`dot`](math.vec3.dot.md) | method | The dot product. |
| <a id="cross"></a>[`cross`](math.vec3.cross.md) | method | The cross product (right-handed). |
| <a id="length"></a>[`length`](math.vec3.length.md) | method | The length. |
| <a id="normalize"></a>[`normalize`](math.vec3.normalize.md) | method | The same direction at unit length; a zero-length vector returns `{ x: 0, y: 0, z: 0 }`. |
| <a id="distance"></a>[`distance`](math.vec3.distance.md) | method | The distance between two points. |
| <a id="applymat4"></a>[`applyMat4`](math.vec3.applyMat4.md) | method | The point transformed by `m`. |
| <a id="applyquat"></a>[`applyQuat`](math.vec3.applyQuat.md) | method | The vector rotated by `q`. |

## Declaration

```ts
export const vec3: {
  add(a: Point3, b: Point3): Point3;
  sub(a: Point3, b: Point3): Point3;
  scale(a: Point3, s: number): Point3;
  dot(a: Point3, b: Point3): number;
  cross(a: Point3, b: Point3): Point3;
  length(a: Point3): number;
  normalize(a: Point3): Point3;
  distance(a: Point3, b: Point3): number;
  applyMat4(a: Point3, m: Mat4): Point3;
  applyQuat(a: Point3, q: Quat): Point3;
};
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `vec3` 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) |
