GeoPy is a Python library that makes geographical calculations easier for the users. In this article we will see how to calculate the distance between 2 points on the earth in two ways. Euclidean Distance works for the flat surface like a Cartesian plain however Earth is not flat.
Distance 2 R a r c t a n a 1 a where the latitude is f the longitude is denoted as l and R corresponds to Earths mean radius in kilometers 6371.
It was the first time I was working with raw coordinates so I tried a naive attempt to calculate distance using Euclidean distance but sooner realized that this approach was wrong. Use the keyword map to typecast the variables simultaneously. To calculate the distance between two points there are two popular algorithm Haversine and Geodesic distance is used. Euclidean Distance works for the flat surface like a Cartesian plain however Earth is not flat.