Vector2D uses the following form: <x, y>
public {Vector2D} Vector2D();
public {Vector2D} Vector2D(Vector2D);
public {Vector2D} Vector2D(Number, Number);
Adds the passed vector to this vector
public {Vector2D} add(Vector2D);
Calculates the angle between the passed vector and this vector, using <0,0> as the point of reference. Angles returned have the range (−π, π].
public {Number} angleBetween(Vector2D);
Calculates the angle to the passed vector from this vector, using this vector as the point of reference.
public {Number} angleTo(Vector2D);
Calculates the distance from this vector to the passed vector.
public {Number} distance(Vector2D);
Calculates the squared distance from this vector to the passed vector. This function avoids calculating the square root, thus being slightly faster than .distance( ).
public {Number} distanceSq(Vector2D);
Divides this vector by the passed vector.
public {Vector2D} divide(Vector2D);
Calculates the dot product of this and the passed vectors
public {Number} dotProduct(Vector2D);
Checks for the numeric equality of this matrix versus another.
public {Boolean} equals(Matrix2D);
Calculates a new right-handed normal vector for the line created by this and the passed vectors.
public {Vector2D} getNormal([Vector2D]);
Calculates the magnitude of this vector. Note: Function objects in JavaScript already have a 'length' member, hence the use of magnitude instead.
public {Number} magnitude();
Calculates the square of the magnitude of this vector. This function avoids calculating the square root, thus being slightly faster than .magnitude( ).
public {Number} magnitudeSq();
Multiplies this vector by the passed vector
public {Vector2D} multiply(Vector2D);
Normalizes this vector (scales the vector so that its new magnitude is 1) For vectors where magnitude is 0, <1,0> is returned.
public {Vector2D} normalize();
Applies a post-scaling to this matrix
public {Matrix2D} scale(Number[, Number]);
Scales this vector such that its new magnitude is equal to the passed value.
public {Vector2D} scaleToMagnitude(Number);
Sets the values of this matrix
public {Matrix2D} setValues(Matrix2D);
public {Matrix2D} setValues(Number, Number, Number, Number, Number, Number);
Subtracts the passed vector from this vector.
public {Vector2D} subtract(Vector2D);
Applies a post-translation to this matrix
public {Matrix2D} translate(Vector2D);
public {Matrix2D} translate(Number, Number);
Calculates the triple product of three vectors. triple vector product = b(a•c) - a(b•c)
public {Vector2D} tripleProduct(Vector2D, Vector2D, Vector2D);
{Vector2D} the triple product as a new vector