Function clampMagnitude

Clamps the magnitude of a point. This is useful when using a Point as a vector, to limit forces.

  • Parameters

    • pt: Point
    • max: number = 1

      Maximum magnitude (1 by default)

    • min: number = 0

      Minimum magnitude (0 by default)

    Returns Point