math docs
    Preparing search index...

    Function signedDistance

    • Returns the distance from point to the polygon's boundary, signed so that points inside the polygon get a negative distance and points outside get a positive one.

      Parameters

      • vertices: number[]

        polygon vertices as a flat array [x0, y0, x1, y1, ...]

      • n: number

        number of vertices to read from vertices

      • point: vec2.Vec2

        the query point

      Returns number

      the signed distance (negative inside, positive outside)