Skip to content

Jaime Rios

  • About
  • Github
  • LinkedIn
  • X

JavaScript

Calculating distance between 2 points on Earth using the Haversine formula

December 2, 2025February 17, 2008 by jaimerios

2016 UpdateThe code and the Xcode project for this article is now also available on GitHub. A while ago, I worked on a project where I had to implement code in C/C++ that could calculate the distance between 2 locations within the United States. It would be nice if the Earth was flat, since this … Read more

Categories Coding Tags C++, Haversine, JavaScript 20 Comments

Recent Posts

  • Package management with CMake’s CPM
  • Automate Evernote using AppleScript
  • Unit Tests and CMake
  • clang static analyzer
  • C++ std::erase and rbegin/rend

Recent Comments

  1. Connecting with C++ – Jaime Rios on Working with REST
  2. Connecting with C++ – Jaime Rios on Making a connection using Swift
  3. Jaime on Xcode 3.1, Perforce and Scripts
  4. jaimerios.com » Blog Archive » Haversine formula now on GitHub on Calculating distance between 2 points on Earth using the Haversine formula
  5. iPhone 3G: How to show locations around a fixed point? | Questions on Calculating distance between 2 points on Earth using the Haversine formula
© 2025 Jaime Rios • Built with GeneratePress