Latitude, longitude and distance
Latitude, longitude and distance
I have latitude and longitude coordinates for a range of cities. Can RATS compute the bilateral distances between them? If so, advice would be appreciated. Many thanks.
Re: Latitude, longitude and distance
The (great circle) distance is relatively straightforward once the latitude and longitude are converted to radians. In what format do you have them now?
Re: Latitude, longitude and distance
Hi Tom, I have the latitude and longitude data in decimal degrees.
Re: Latitude, longitude and distance
See https://www.movable-type.co.uk/scripts/latlong.html. If you have latitude as running from -90 (South) to +90 (North), then you convert to radians by multiplying those by %PI/180. If you have longitude from -180 to +180, similarly convert to radians by multiplying by %PI/180. The ATAN2(y,x) function in the Javascript code is the RATS function %ATAN(y/x). (ATAN2 is designed to handle x=0).