Click to See Complete Forum and Search --> : Map co-ordinates


Henrycoffin
06-12-2003, 06:39 AM
Hi all,

I am trying to create a script that will work out the distance between one place and another using map co-ordinates.

Does anyone know the formula for doing this calculation.

Many thanks

AdamGundry
06-12-2003, 08:23 AM
Oh, the joy of mathematics. You need to use Pythagoras's theorem.

You can use this line (your code will need to calculate $distance_across and $distance_up):
$distance = sqrt($distance_across*$distance_across + $distance_up*$distance_up);

Also see http://www.php.net/manual/en/function.sqrt.php

Adam

Henrycoffin
06-12-2003, 08:43 AM
thanks

is the distance up and the distance across the os grid reference ?