# Equation to check if a set of vertices form a real polygon?

Whats the equation to make sure a set of vertices, in clockwise or counterclockwise winding, actually form a polygon (without overlapping edges)?

-
How do you define clockwise or counterclockwise winding? Can you give an example of a set of vertices satisfying this condition without forming a polygon? – t.b. Jul 20 '11 at 20:44
Do you care about convexity? – Yuval Filmus Jul 20 '11 at 21:40

There is a linear-time algorithm but it depends on Chazelle's famous solution of polygon triangulation in linear time, and so is not practical. There is an $O(n \log n)$ algorithm in the book by Preparata and Shamos.