Added a function to triangulate points.