math docs
    Preparing search index...

    Function area

    • Returns the (non-negative) area of the polygon.

      Parameters

      • vertices: number[]

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

      • n: number

        number of vertices to read from vertices

      Returns number

      the absolute area