# Show that this algorithm does not work for determining convex polygons

Context

Consider this algorithm. If the set $\{\angle p_ip_{i+1}p_{i+2} : i=0,...,n-1\}$ does not contain left and right turns, output "yes the polygon is convex"; otherwise, "no".

Consider this nonsimple polygon having 4 vertices; the algorithm above will output "yes" as the set of points does not contain both left and right turns, yet the polygon is not convex. Is this a good counterexample rendering the above algorithm incorrect?

• The face in the interior seems to be a a quadrilateral with straight sides. The only way I know of for one of these to be non-convex is if there is some interior angle greater than $\pi$ radians. The one you present seems like each of the four interior angles is approximately $\pi/2$. – Kaya Mar 29 '14 at 0:13