Socket
Book a DemoInstallSign in
Socket

find-basis-3d

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-basis-3d

Finds an orthonormal basis with at least one vector parallel to a given vector

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

find-basis-3d

Given a single "up" vector, finds a triple of orthogonal basis vectors such that the first two are orthogonal to the last, which is parallel to the input vector. This can be used to assign tangent spaces to flat planes.

Install

npm install find-basis-3d

Example

var findBasis = require("find-basis-3d")

var normal = [1, 0.5, 0]

console.log(findBasis(normal))

require("find-basis-3d")(up)

Finds an orthonormal basis aligned along up.

  • up is the z-vector for the new basis

Returns An array of 3 vectors, where the first two vectors are orthogonal to up, and the last is parallel. All vectors are orthonormal.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

basis

FAQs

Package last updated on 19 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts