|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Saturday, May 04, 2013 11:13 AM
Points: 9,855,
Visits: 9,374
|
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 3:02 AM
Points: 235,
Visits: 560
|
|
Please could you supply us a "km version" of this nice script. In Europe, Australia, Asia, etc. we don't use miles or feet. ;)
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:49 AM
Points: 42,
Visits: 672
|
|
Really neat and just what I was looking for.
Many thanks Tim
Tim
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 6:29 AM
Points: 2,551,
Visits: 18,885
|
|
RBarryYoung, am I missing something here? the function name is LatLonDistance(), but the tests use calculateDistance()?
Is there a missing piece to this, or is it just a naming convention typo?
Thanks,
Jon
--------------------------------------------------------- How best to post your question How to post performance problems Tally Table:What it is and how it replaces a loop
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, April 15, 2011 2:01 PM
Points: 2,
Visits: 19
|
|
Because the earth is not strictly spherical (it "flattens" a bit due to its rotation), there's a mathematical adjustment that can be made which makes the result even more accurate, given any two locations worldwide.
(I researched this about a year ago for a web application involving searching for points of interest within a specified radius of a reference point. I found various algorithms and chose one, which I translated to VBScript. It's nice to see the SQL implementation.)
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 6:29 AM
Points: 2,551,
Visits: 18,885
|
|
kevin (2/17/2009) Because the earth is not strictly spherical (it "flattens" a bit due to its rotation), there's a mathematical adjustment that can be made which makes the result even more accurate, given any two locations worldwide.
(I researched this about a year ago for a web application involving searching for points of interest within a specified radius of a reference point. I found various algorithms and chose one, which I translated to VBScript. It's nice to see the SQL implementation.)
And that adjustment is?
--------------------------------------------------------- How best to post your question How to post performance problems Tally Table:What it is and how it replaces a loop
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 15, 2012 6:37 AM
Points: 9,
Visits: 31
|
|
| As you are using Lat/Long and I do not see any conversion, I am assuming that the distance is measured in Nautical Miles not Statute Miles is it not?
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 21,357,
Visits: 9,539
|
|
Henk Schreij (2/17/2009) Please could you supply us a "km version" of this nice script. In Europe, Australia, Asia, etc. we don't use miles or feet. ;)
Just do Result time 1.6. Easy enough to include in the function :D.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 3:02 AM
Points: 235,
Visits: 560
|
|
Quote: "Just do Result time 1.6. Easy enough to include in the function."
I was hoping for new constants in the formula ;) But I realize the formula doesn't need a 6 or more numbers precision.
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 21,357,
Visits: 9,539
|
|
I'm sure it's possible... but to avoid redoing 1 year of maths or waiting for someone to redo the calculations for that constant, I'll just take the small perf hit and do result * 1.6 .
|
|
|
|