Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

quaternionjs

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

quaternionjs

A simple API for working with quaternions. useful for 3d rotations

latest
npmnpm
Version
0.0.2
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

QuaternionJS

a simple API for creating an manipulating quaternions which are useful in 3D graphics involving rotations.

to use in the browser, just include <script src="quaternion.js"></script>

for use in node, just run npm install quaternionjs

Here's a small demo

  var quaternion = require('quaternionjs')
  var q = quaternion()
    .fromAxis({x: 1, y: 0, z: 0}, theta)
    .multi(quaternion().fromAxis({x: 0, y: 1, z: 0}, theta))
    .multi(quaternion().fromAxis({x: 0, y: 0, z: 1}, theta))
  // rotate all the points in `points` along the x, y, and z axis
  return points.slice(0).map(q.multiVec)

checkout example/index.html for an demo or have a gander at the source code.

FAQs

Package last updated on 07 Nov 2013

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