works with spherical coordinates, but a few polygon has 7 vertices, need debugging later