My implementation can be found here:
https://github.com/casteng/base/blob/dev/Geometry.pas
Method T2DPointList.Triangulate()