You are on page 1of 4


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:

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 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.

2. for instance.YOUR TASK: 1) Your task is to modify the quovadis app you just finished and change in such a way that the WebViewer shows directions from your current location to your home (or your granparent's home.173403500 .356127800. 2) Your second task is to modify the quovadis app to show in a WebViewer component the route between your current location and your home (or your grandparent's).103757600&daddr=41. To help you. 2. You should also calculate approximate distance from your current location to your home. try the following URL and investigate how it works: