## About the Mileage Calculator
We have a dataset that includes latitudes and longitudes for a variety of cities. First, we approximate the distance between two cities in nautical miles. A nautical mile is an angular measurement equal to one arc-minute along any great circle of the earth. The program computes distance as though the earth were a sphere, which it isn't, but errors should be negligable. ## Method of SolutionLatitude and longitude combined with the radius of the sphere provide three-dimensional polar coordniates. The problem yields the same angle for any radius, so a radius of 1 is used. The program converts the polar coordinates to cartesian (x,y,z) coordinates with the following equations: x = cos(latitude) * cos(longitude) y = sin(latitude) * cos(longitude) z = sin(latitude) After computing the (x,y,z) coordinates for the two points, the distance between them is calculated as: c = sqrt((x The triangle formed by the center of the sphere and the two points contains the angle in question. The sides of the triangle are the distance computed above and two radii (1). The Law of Sines yeilds the following equation for our angle: a = acos((2-c As nautical miles are arc minutes, the answer is a*60 nautical miles. ## Questions?If we're missing data for your city, there's not much we can do. Direct other questions or comments here. ^{1} McGraw Hill Dictionary of Scientific and Technical Terms, Second Edition |