Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-plane-normal

mattdesl2.3kMIT1.0.0

gets a plane's normal from 3 points

get, plane, from, three, 3, points, normal, normalize, normals, planes, unit, vector, math

readme

get-plane-normal

stable

Gets a plane's normal from 3 points on that plane.

var point1 = [0, 1, 0], 
    point2 = [1, 1, 0.5], 
    point3 = [0, 1, -2]

var norm = normal([], point1, point2, point3)
console.log(norm) // [0, 1, 0]

Usage

NPM

out = normal(out, point1, point2, point3)

With three points on the same plane, determines the unit normal and stores it in out [x, y, z].

Returns out.

License

MIT, see LICENSE.md for details.