ixfx
    Preparing search index...

    Namespace Vectors

    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.

    Functions

    clampMagnitude

    Clamps the magnitude of a vector

    divide

    Returns a / b.

    dotProduct

    Calculate dot product of a vector

    fromLineCartesian

    Returns a Cartesian-coordinate vector from a line a -> b

    fromLinePolar

    Returns a polar-coordinate vector from a line a -> b

    fromPointPolar

    Create a vector from a point

    fromRadians
    multiply

    Returns a * b.

    normalise

    Returns the normalised vector (aka unit vector). This is where direction is kept, but magnitude set to 1. This then just suggests direction.

    quadrantOffsetAngle
    subtract

    Returns a - b.

    sum

    Returns a + b.

    toCartesian

    Converts a Vector to a Cartesian coordinate. If the provided value is already Cartesian, it is returned.

    toPolar

    Converts a vector to a polar coordinate. If the provided value is already Polar, it is returned.

    toRadians
    toString

    Return a human-friendly representation of vector

    Type Aliases

    Vector