Results 1 to 3 of 3

Thread: Map Co-Ordinates

  1. #1
    Join Date
    Jun 2003
    Worthing, Sussex, UK

    Map Co-Ordinates

    I recently posted a thread asking how i could claculate the distance between two places using map co-ordinates and i recieved this very helpful answer.

    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);

    my only problem now is how to calculate $distance_across and $distance_up what data do i use and how do i use it.

    Any help would be greatly appreciated


  2. #2
    Join Date
    Nov 2002
    Dartmoor [Holiday]
    It depends on the format your map co-ordinates are in. If they are just simple numbers, you can use:

    $distance_across = abs($x1 - $x2);
    $distance_up = abs($y1 - $y2);

    This requires you to have the two co-ordinates as pairs of numbers ($x1, $y1 and $x2, $y2). If your map data is in a different format (e.g. letters) you will need to convert it first.

    "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
    Worthing, Sussex, UK
    Thanks guys you have been really helpful

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