Python Shorts — Earth Distance

John Clark Craig
UFO-Track
Published in
4 min readJun 24, 2022

--

Here’s a short Python function that makes it easy to calculate the shortest distance between any two points on the planet.

Map of the world with someone’s hands pointing out landmarks.
Photo by Glenn Carstens-Peters on Unsplash

The distance between two x,y points in a plane is easily found using the Pythagorean theorem. However, the distance between two points on a sphere, such as the earth, is more complicated. But Python makes it easy! Here’s the whole function to get it done…

--

--

John Clark Craig
UFO-Track

Author, inventor, entrepreneur — passionate about alternate energy, technology, and how Python programming can help you hack your life.