quat-from-unit-vec3
creates a quaternion from two unit vectors
Last updated 11 years ago by mattdesl .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install quat-from-unit-vec3 
SYNC missed versions from official npm registry.

quat-from-unit-vec3

stable

Creates a quaternion from two (normalized) unit vectors. Adapted from this blog post.

Install

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

Example

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

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

Current Tags

  • 1.0.0                                ...           latest (11 years ago)

1 Versions

  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE