DistanceBetweenPoints ( Lat1; Lon1; Lat2; Lon2; Units )
Rate this function: Average rating: 4.2 (5 votes) Discuss this Custom Function
Vaughan Bromfield, Vaughan Bromfield Design
http://www.google.com.au/
Calculates the distance between any two points on Earth.
Sample Input:
| DistanceBetweenPoints ( 0.592539; 2.066470; 0.709186; 1.287762; "nm" ) |
|
Sample Output:
|
Description:
Based on "Aviation Formulary v1.42" by Ed Williams <http://williams.best.vwh.net/avform.htm>.
Calculates the distance between two points on Earth (assuming earth's radius is 6366.71 km) based on the second "Great Circle Distance Between Points" formula that proports to give less rounding error for short distances.
Since FMP's formula dictionary does not contain asin, the distance formula is modified to use atan as described in the "Implementation Notes". The format of the custom function below attempts to make these original formulae explicit.
Latitude and Longitude are entered in decimal degrees.
The Units variable accepts "radians", "nm", "km" and "miles". Empty latitude, longitude variables, or unrecognised units entries cause the function to return "?".
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:
|
Newest Custom Functions:
| 1. |
webviewer_button ( content; textCol; bgCol ) |
| |
(Wed, Mar 03, 11:18am) |
| 2. |
RemoveCommonValues ( Array ; ComparisonArray ) |
| |
(Wed, Feb 24, 9:39pm) |
| 3. |
DistanceGeoCoord ( Lat1deg ; Lat1mm ; Lat1ss ; Lon1deg ; Lon1mm ; Lon1ss ; Lat2deg ; Lat2mm ; Lat2ss ; Lon2deg ; Lon2mm ; Lon2ss ; U ; Version ) |
| |
(Wed, Feb 24, 2:20pm) |
| 4. |
fnGoogleLineChart ( chtitle ; xtitle ; ytitle ; xfield ; yfield ; color ) |
| |
(Tue, Feb 23, 1:30pm) |
| 5. |
StringConstruct ( text ; prefix ; suffix ; altText ) |
| |
(Fri, Feb 19, 10:57am) |
| 6. |
ShowValueCascade ( fields ; altText ) |
| |
(Fri, Feb 19, 10:44am) |
| 7. |
ShowValue ( text; altText ) |
| |
(Fri, Feb 19, 10:28am) |
| 8. |
timeFormat ( thetime ; leader ) |
| |
(Wed, Feb 17, 7:44pm) |
 |
|
How do I use this correctly?
I have copied into Custom Functions but get an error "The specified parameter cannot be found" Lat1 is highlighted.
Any ideas?
NA, Oz
March 22, 2009 12:08am