Solution (source code)

= Solution

Use
``
type Point = (Double,Double)
type Polygon = [Point]
``
A valid <polygon> is a finite list of at least three <vertices> in boundary order, with the final vertex connected back to the first. The first vertex is not repeated at the end. A simple <polygon> also has no intersecting nonadjacent <edges>. Numerical routines below use finite coordinates; `NaN` and infinite coordinates are outside this representation's intended domain.