User Tag List

Results 1 to 5 of 5

Thread: Get distance from 2 locations (Lat/Long)?

  1. #1
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProUnicode Add-on
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,038
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Question Get distance from 2 locations (Lat/Long)?

    I've searched the web for a formula to calculate the distance from 2 points with latitude/longitude:

    ACos(Sin(value( "lat1" ))*Sin(value( "lat2" ))+Cos(value( "lat1" ))*Cos(value( "lat2" ))*Cos(value( "long2" )-value( "long1" )))*6371.0

    (6371 is the earth radius in km) from here: http://www.movable-type.co.uk/scripts/latlong.html and here: http://itouchmap.com/latlong.html


    but the distance dont work for me (in my case should be under 10km, the formula shows me something like 278)

    what I'm doing wrong here?!?

    thanks for your help!

    Richie

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is some functions I have used for this calc in the past that are very accurate:

    http://www.galcho.com/Blog/default.aspx?date=2007-05-17

    You should be able to convert the T-SQL or C# function easily.

  3. #3
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProUnicode Add-on
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,038
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Does the Expression Editor Support a radians function?!?

  4. #4
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProUnicode Add-on
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,038
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    SOLUTION!!:

    (ACos(Sin(value( "lat1" ))*Sin(value( "lat2" ))+Cos(value( "lat1" ))*Cos(value( "lat2" ))*Cos(value( "long2" )-value( "long1" )))*6371.0)/180*3.141592654

    (what i have missed was the conversation to radiant)

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,143
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    *Bookmarks this thread* Always such a complicated equation, easier to refer here when needed

Similar Threads

  1. Calculate Distance with LAT/LONG
    By StingRay in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 2nd July 2012, 12:58 PM
  2. access to GPS or Locations?
    By Gibbon in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 9th August 2011, 11:51 AM
  3. Help with Directory Locations for install
    By AbnVet in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 30th December 2006, 05:42 PM

Posting Permissions

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