www.webdeveloper.com
Results 1 to 3 of 3

Thread: Map co-ordinates

  1. #1
    Join Date
    Jun 2003
    Location
    Worthing, Sussex, UK
    Posts
    5

    Map co-ordinates

    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

  2. #2
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    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
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  3. #3
    Join Date
    Jun 2003
    Location
    Worthing, Sussex, UK
    Posts
    5
    thanks

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles