About the Mileage CalculatorWe 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.^{1} We convert nautical miles to statute miles using the international measure of one nautical mile is 1852 meters. 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_{1}-x_{0})^{2} + (y_{1}-y_{0})^{2} + (z_{1}-z_{o})^{2}) 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^{2})/2) 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. Google AdsIf you're a repeat visitor, you may notice that the Google Ads are new. We like Google and thought we'd give it a try. ^{1} McGraw Hill Dictionary of Scientific and Technical Terms, Second Edition |