You are on page 1of 4

APP
In this app we're going to learn to:
- First, to position ourselves on Earth surface with two coordinates: latitude and longitude.
- Second, given a known point on Earth (given by latitude and longitude), get the
approximate distance (in a straigth line) between us and this point.
- Third, to show the route between your present location and a given point.
The code we'll need is as follows:

In this example, latitude and longitude (in blue) represent the location of Plaça Catalunya
in Barcelona.
To get different coordinates (for instance, the place where you live), you may use:
http://www.gps-coordinates.net/

It is not straighforward to believe because we are projecting a spheric Earth surface on a flat map. remember Columbus' travel and bear in mind that the Earth is not flat ! So in reality you're calculating distances between two points in an approximately spheric surface. In the following picture. between Europe and North America) and ships. the yellow path is shorter than the blue one.CALCULATING DISTANCE BETWEEN TWO POINTS ON EARTH SURFACE First thing. . The closest path between two points in a spheric surface is NOT a straight line. Great Circle Distance is routinely used by airplanes flying long distances (for instance. but a curved line known in mathematics as Great Circle Distance or orthodromic (straight line is called loxodromic in mathematics). to calculate the distance between two points.

you can browse the following website: http://geokoder. . you should use 111.12 instead The final result will be: The number 57.com/distances As a compromise between accuracy and computational burden let's use the Approximate distance: Note that the number 69.1 in the above equations will yield a result in (imperial) miles.3 is the conversion factor from degrees to radians ( 360 degrees = 2 x PI radians).To obtain distance equations. To get a distance in kilometers.