p5js-vector-standalone
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

Typescript standalone port of the wonderful Vector library from p5.js.

Ported from here

Usage

import { Vector } from 'p5js-vector-standalone';

const vec1: Vector = new Vector(10, 0, 0);
const vec2: Vector = new Vector(20, 10, 0);

vec1.add(vec2); // vec1 = {x: 30, y: 10, z: 0};

List of methods

  • copy()
  • add()
  • rem()
  • sub()
  • mult()
  • div()
  • mag()
  • magSq()
  • dot()
  • cross()
  • dist()
  • normalize()
  • limit()
  • setMag()
  • heading()
  • setHeading()
  • rotate()
  • angleBetween()
  • lerp()
  • reflect()
  • array()
  • equals()

List of static methods

  • fromAngle()
  • fromAngles()
  • random2D()
  • random3D()
  • add()
  • rem()
  • sub()
  • mult()
  • rotate()
  • div()
  • dot()
  • cross()
  • dist()
  • lerp()
  • mag()
  • normalize()

Thanks

Huge thanks to everyone involved with p5.js

Readme

Keywords

none

Package Sidebar

Install

npm i p5js-vector-standalone

Weekly Downloads

0

Version

1.2.1

License

ISC

Unpacked Size

98.3 kB

Total Files

7

Last publish

Collaborators

  • xposedbones