An implementation of two dimensional vector math including a rich toolset for vector operations. It's also the math
library behind eSoccer, a cross-platform multiplayer HTML5 game developed at University of
Applied Sciences Bonn.
JustMath
Augments core Math
Allows replacement of all methods (e.g. custom implementations of JustMath.sqrt(value))
Adds some convenience methods (JustMath.sq(value), JustMath.cot(angle))
JustMath.Vec2
Vector instantiation (new Vec2(vOrX[, y])) and cloning (Vec2#clone())
Direct modification through Vec2#x and Vec2#y, also provides getters (Vec2#getX(), Vec2#getY()) and a setter
(Vec2#set(vOrX[, y]))
Vector rotation (Vec2#rot(angle)) and direction calculation (Vec2#dir())
Vector projection (Vec2#project(b)) and rejection (Vec2#reject(b))
Vector reflection (Vec2#reflect(n)), also with component-wise (projected and rejected component) scaling
(Vec2#reflectAndScale(n, projectFactor, rejectFactor))
Vector interpolation (Vec2#lerp(p, percent))
Vector containment in rectangle (Vec2#inRect(p1, p2))