gradum-kit - v0.1.0
    Preparing search index...

    Function projectPolygonOntoAxis

    • Function

      projectPolygonOntoAxis

      Parameters

      • points: Point[]

        The polygon's vertices.

      • axis: Point

        The axis to project onto. Need not be normalized.

      Returns [number, number]

      The minimum and maximum positions along the axis.

      Flatten a polygon onto an axis and return the span it covers there. This is the building block of the separating-axis test in hasSeparatingAxisForPolygons.