Tests whether the polygon is convex. Works for both winding orders. Assumes a simple (non-self-intersecting) polygon; collinear vertices are allowed.
polygon vertices as a flat array [x0, y0, x1, y1, ...]
[x0, y0, x1, y1, ...]
number of vertices to read from vertices
vertices
true if the polygon is convex
Tests whether the polygon is convex. Works for both winding orders. Assumes a simple (non-self-intersecting) polygon; collinear vertices are allowed.