# quat-from-unit-vec3

> creates a quaternion from two unit vectors

Latest version **1.0.0** (published 2015-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install quat-from-unit-vec3
pnpm add quat-from-unit-vec3
yarn add quat-from-unit-vec3
bun add quat-from-unit-vec3
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-09-28 |
| First published | 2015-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | unit, vec, vec3, gl-vec3, gl-quat, quat, quaternion, quaternions, normalize, normalized, vectors, vector |

## Links

- npm: https://www.npmjs.com/package/quat-from-unit-vec3
- Repository: https://github.com/Jam3/quat-from-unit-vec3
- Issues: https://github.com/Jam3/quat-from-unit-vec3/issues
- npm.io page: https://npm.io/package/quat-from-unit-vec3

## Dependencies (2)

- [gl-quat](https://npm.io/package/gl-quat.md) ^1.0.0
- [gl-vec3](https://npm.io/package/gl-vec3.md) ^1.0.3

## Recent versions

- 1.0.0 (latest) — 2015-09-28

## README

# quat-from-unit-vec3

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Creates a quaternion from two (normalized) unit vectors. Adapted from [this blog post](http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final).

## Install

```sh
npm install quat-from-unit-vec3 --save
```

## Example

```js
var fromUnitVec3 = require('quat-from-unit-vec3')

var vecA = [0, 0, 0]
var vecB = [0, 0, 1]
var quat = fromUnitVec3([], vecA, vecB)
//=> [ 0, 0, 0, 1 ]
```

## Usage

[![NPM](https://nodei.co/npm/quat-from-unit-vec3.png)](https://www.npmjs.com/package/quat-from-unit-vec3)

#### `quat = fromUnitVec3(quat, a, b)`

Forms a quaternion from two normalized unit vectors, `a` and `b` (3-component arrays). The value is stored in `quat` (a 4-component array) and returned.

## License

MIT, see [LICENSE.md](http://github.com/Jam3/quat-from-unit-vec3/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/quat-from-unit-vec3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
