benbovy / spherely

Manipulation and analysis of geometric objects on the sphere.
https://spherely.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
121 stars 8 forks source link

ENH: Added length and perimeter implementation #77

Open JoelJaeschke opened 6 days ago

JoelJaeschke commented 5 days ago

I am still getting used to thinking in spherical geometries. The test case I wrote for the perimeter function used a polygon that was rectangular in my head, so I expected its perimeter to be $4\pi / 180°$. However, not only this assumption was wrong (as angular distances between two points with the same latitude at higher latitudes are smaller than those near the equator), but I also did not take into account that all points at the poles are actually coincident, so my result was $3\pi/180°$ which I assumed to be some sort of bug.

Sorry for the confusion, everything was fine from the start!