Vector object for canvas etc.
$ component install component/vector
varVector=require('vector');vara=newVector(5,5);varb=newVector(10,10);a.distance(b);or without new:
varvec=require('vector');vara=vec(5,5);varb=vec(10,10);a.distance(b);Initialize a new Vector with x / y.
Return a negated vector.
Add x / y.
Sub x / y.
Multiply x / y.
Divide x / y.
Check if these vectors are the same.
Return a clone of this vector.
Return angle in radians.
Return angle in degrees.
Return the distance between vectors.
Return the linear interpolation between vectors given a step point.
Return the middle position between vectors.
Return "(x, y)" string representation.
MIT