Geographic Distance and Azimuth Calculator
This PHP class can be used to calculate the distance between two points of latitude and longitude. There is also a C++ version linked to from the page if you need it.
Date : 2009-04-28
Geographic Distance and Azimuth Calculator version 1.0
This PHP class can be used to calculate the distance between two points of latitude and longitude. The formulas utilized are the Great Circle method, Ellipsoid Approximation, and a more accurate Ellipsoid Calculation. A method is provided to also calculate azimuth between the two points on the earth.
I don't know if you've ever needed these functions, but when you need them, you need them. I've used them to find hotels within a radius of an airport. Find other airports nearby for extended fare searches. Many modern site feature require this kind of math. Now you know where to find it.
Also the C++ version including the raw formulas can be found here:
No comments yet