Skip to content

Releases: broadsw0rd/vectory

v1.2.3

22 Jun 06:52
Compare
Choose a tag to compare

Polish

  • Updated dependencies

v1.2.2

18 Nov 12:18
636c234
Compare
Choose a tag to compare

Fixed

  • Fixed Wrong .angleTo() computing #41

v1.2.1

04 Sep 08:30
Compare
Choose a tag to compare

Added

v1.2.0

29 Aug 12:40
Compare
Choose a tag to compare

Added

  • Implemented vector rotation #34

    • Vector.rotate(theta, vector)
    • Vector.prototype.rotate(theta)
    • Vector.irotate(theta, vector)
    • Vector.prototype.irotate(theta)
  • Implemented alias Vector#clone() for Vector#copy() #35

  • Implemented filter for benchmark #29

npm run behch -- --filter add

list of available filters: create, add, sub, mul, div, lerp, norm, mag, dot, dist, angle, rotate, reset, copy, convert, equal, swizzling, iterator

Fixed

  • Fixed vectors' equality: implemented usage of Number.EPSILON #36

Removed

  • Dropped support of Node < 4

v1.1.0

23 Jul 08:50
Compare
Choose a tag to compare

Added

  • Implemented Vector.prototype.set(x, y)
  • Implemented Vector.prototype.toArray()
  • Implemented Symbol.toStringTag support

v1.0.0

16 Jul 07:29
Compare
Choose a tag to compare

Yet another 2d vector implementation for basic motion

this.velocity.iadd(this.acceleration)
this.position.iadd(this.velocity)
this.acceleration.zero()

with rare methods such as lerp

var prev = new Vector(1, 2)
var next = new Vector(3, 4)
prev.lerp(next, 0.5) // Vector(2, 3)

and swizzling

var vector = new Vector(1 ,2)
vector.yx // Vector(2, 1)

with some ES6 support

var vector = new Vector(0, 0)
var vec3 = [...vector, 0] // [0, 0, 0]

and FP ability

// create vectors from raw data and scale them twice
var data = [[1, 2], [3, 4]/*,  ... */]
var vectors = data.map(Vector.from).map(Vector.mul.bind(null, 2))

Want to know more?