mwg API
    Preparing search index...

    Function cellIndex

    • The row-major index of (x, y): its position in a flat width * height array.

      Deliberately unchecked. Call cellInside when the coordinates are not already known to be valid; an out-of-range x otherwise lands on a neighbouring row rather than failing, and a negative one on the row before it.

      Parameters

      • width: number
      • x: number
      • y: number

      Returns number