Not a complete answer to your question, but if you have a common polygon (concave, convex, any), and you want to triangulate it (perhaps for subsequent rendering in the OpenGL style), you could look at packages with a Delaunay triangulation constraint, One of these examples is the Triangle package, which is considered fast and reliable.
As I understand it, the algorithms used in Triangle show O(nlogn) runtime complexity.
Darren engwirda
source share