Convex Polygon

Given an ordered list of distinct two-dimensional points whose consecutive vertices, including the last and first, form a simple polygon, return true if the polygon is convex and false otherwise. The input points are joined in the supplied order. This is a convexity check, not a convex-hull construction.

Examples
Input: [0,0,4,0,4,4,0,4]
Output: 1

Convex Polygon

Given an ordered list of distinct two-dimensional points whose consecutive vertices, including the last and first, form a simple polygon, return `true` if the polygon is convex and `false` otherwise. The input points are joined in the supplied order. This is a convexity check, not a convex-hull construction.