Releases: broadsw0rd/vectory
Releases · broadsw0rd/vectory
v1.2.3
v1.2.2
v1.2.1
Added
- Support of es6 pkg.module #38
v1.2.0
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()
forVector#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
Added
- Implemented
Vector.prototype.set(x, y)
- Implemented
Vector.prototype.toArray()
- Implemented
Symbol.toStringTag
support
v1.0.0
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))