title: Triangulation algorithm
body: <p>I've decided to create a simple demo, dividing a polygon into triangle set. Here what i've got so far:</p>
  
  <p><em>A sequential vertex list is given (P1) forming polygon edges (<strong>polygon is not convex in most cases</strong>); a triangle set is needed</em></p>
  
  <p>Loop through all the vertices within the polygon P1 and find the one (v), which will satisfy next clauses:</p>
  
  <ol>
  <li><p><em>remove v from polygon and save the new one to P2</em> previous vertex to v
  connected to its next one form a
  line which do not cross any of P2
  edges</p></li>
  <li><p>v is not inside P2</p></li>
  </ol>
  
  <p>If these are satisfied, we can replace P1 with (P2 + <em>triangle( prev(v), v, next(v))</em> ) and repeat this action until P1 contains more than 3 vertices.</p>
  
  <p><strong>So, the questions are</strong>: is this algorithm correct and how it could be implemented using C / C++ using the most obvious and simple way?</p>