Clamps the magnitude of a vector
Returns a / b
.
Calculate dot product of a vector
Returns a Cartesian-coordinate vector from a line a -> b
Returns a polar-coordinate vector from a line a -> b
Create a vector from a point
Returns a * b
.
Returns the normalised vector (aka unit vector). This is where direction is kept, but magnitude set to 1. This then just suggests direction.
Returns a - b
.
Returns a + b
.
Converts a Vector to a Cartesian coordinate. If the provided value is already Cartesian, it is returned.
Converts a vector to a polar coordinate. If the provided value is already Polar, it is returned.
Return a human-friendly representation of vector
Helper functions for working with vectors, which can either be a Points.Point or Polar Polar.Coord. While most of the functionality is provided in either of those modules, the Vector module lets you cleanly interoperate between these two coordinates.