@julian-wasmeier-titanom/vectors

1.1.4 • Public • Published

Vectors

Usage

pnpm add @julian-wasmeier-titanom/vectors

import Vector from '@julian-wasmeier-titanom/vectors'

or

const Vector = require('@julian-wasmeier-titanom/vectors')

new Vector(x, [y], [z])

Creates a new Vector

Vector.add(vector)

Takes a Vector and adds it to the Vector it has been called on. Returns a new Vector with the sum.

Vector.subtract(vector)

Takes a Vector and subtracts it from the Vector it has been called on. Returns a new Vector with the difference.

Vector.dot(vector)

Takes a Vector and returns the dot product of the passed Vector and the Vector it has been called on.

Vector.magnitude

The magnitude of the vector.

Vector.scalarMul(scalar)

Takes a number and returns a new Vector whose values have been multiplied with said scalar.

Vector.cross(vector)

Returns the cross product of the Vector it has been called on and the passed Vector.

Readme

Keywords

none

Package Sidebar

Install

npm i @julian-wasmeier-titanom/vectors

Weekly Downloads

0

Version

1.1.4

License

MIT

Unpacked Size

10.7 kB

Total Files

7

Last publish

Collaborators

  • julian-wasmeier-titanom