math docs
    Preparing search index...

    Function isConvex

    • Tests whether the polygon is convex. Works for both winding orders. Assumes a simple (non-self-intersecting) polygon; collinear vertices are allowed.

      Parameters

      • vertices: number[]

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

      • n: number

        number of vertices to read from vertices

      Returns boolean

      true if the polygon is convex