math docs
    Preparing search index...

    Function closestPoint

    • Calculates the closest point on a line segment to a given point

      Parameters

      • out: vec2.Vec2

        Output parameter for the closest point

      • point: readonly [number, number]

        The point

      • a: readonly [number, number]

        First endpoint of the segment

      • b: readonly [number, number]

        Second endpoint of the segment

      Returns vec2.Vec2