vector3d

1.0.5 • Public • Published

Build Status Coverage Status npm License JavaScript Style Guide

vector3d

Just another Javascript implementation of immutable 3D vectors.

install

browser

<script type="text/javascript" src="vector3d.min.js"></script>

node

npm install vector3d

usage

// Create vectors by assigning each coordinate.
const v1 = Vector3d(1.2, 3.4, 5.6)
const v2 = Vector3d(7.8, 9.1, 2.3)

// Set/return Cartesian coordinates.
v1.x()
// => 1.2

v2.x(4.5)
// => Vector3d(4.5, 3.4, 5.6)


// Add/subtract two vectors.
v1.add(v2)
// => Vector3d(9.0, 12.5, 7.9)

v1.sub(v2)
// => Vector3d(-6.6, -5.7, 3.3)

documentation

At the moment, documentation is available in the source code.

Readme

Keywords

none

Package Sidebar

Install

npm i vector3d

Weekly Downloads

6

Version

1.0.5

License

MIT

Unpacked Size

14.4 kB

Total Files

6

Last publish

Collaborators

  • enys