Random Points In N-polygon

What inPolygon() does is that divide n-polygon into n-3 triangles and pick one of them(by putting weight according to each triangle's area), finally calls inTriangle() with that triangle.