polygon triangulation in O(nlogn)