Skip to content

Typescript standalone version of the wonderful Vector library made by the team at p5.js

Notifications You must be signed in to change notification settings

xposedbones/p5js-vector-standalone

Repository files navigation

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

About

Typescript standalone version of the wonderful Vector library made by the team at p5.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published