The polygon triangulation is one critical algorithm for dealing with most famous problem in computational geoemtery "The art-gallery problem".
Apart from the naive, monotone partioning and convex partioning algorithms, the ear clipping algorithm is also one crucial implementation for dealing with the art-gallery problem.
This algorithm triangulates a polygon using earclipping algorithm. This functions at a complexity of O(n^2). It takes the polygon vertices as a input from a text file.
Demo Output 1:-
Demo Output 2:-
Demo Output 3:-
The above code does not use any pre-built compuation geometry libraries to do the partioning, rather it is a raw implemention of the ear clipping algorithm.