# `math.quat.fromUnitVectors`

> 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.

Method of [`math.quat`](math.quat.md) · stable · since 2.0.0

```ts
fromUnitVectors(from: Point3, to: Point3): Quat;
```

The shortest rotation from one unit vector to another. For opposite vectors
(dot(from, to) + 1 < `Number.EPSILON`), the half-turn about (−from.y, from.x, 0) when
|from.x| > |from.z|, else about (0, −from.z, from.y), normalised:
`fromUnitVectors(+Z, −Z)` is `{ x: 0, y: -1, z: 0, w: 0 }`.

## Generic-API test (spec 3.1)

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