MeasureGreatCircle Method
Description
Measures the Great Circle distance between two positions.
Syntax
Visual Basic |
---|
Public Function MeasureGreatCircle( _ ByVal x1 As Double, _ ByVal y1 As Double, _ ByVal z1 As Double, _ ByVal x2 As Double, _ ByVal y2 As Double, _ ByVal z2 As Double, _ ByVal datum As String _ ) As Double |
Parameters
- x1
-
The x coordinate of the start point of the measurement.
- y1
-
The y coordinate of the start point of the measurement.
- z1
-
The z coordinate of the start point of the measurement.
- x2
-
The x coordinate of the end point of the measurement.
- y2
- The y coordinate of the end point of the measurement.
- z2
- The z coordinate of the end point of the measurement.
- datum
- The Geodetic Datum to do the measuring within.
Return Type
The Great Circle distance found.
The measurement is done using the following algorithm:
- Transform (x1#,y1#,z1#) and (x2#,y2#,z2#) into the Geodetic Datum.
- Drop the two points onto the surface of the geodetic datum (i.e. ignore heights).
- Get the average latitude of the two points.
- Get the radius of the geodetic datum at the average latitude.
- Get the angle separating the two points in radians.
- Multiply the radius by the angle.
The radius of the geodetic datum at the average latitude is approximated as follows:radAve# = radEquator# + (radPole# - radEquator#) * sin(latAve#)
Remarks
Available: GEO D OD SISpy
Group:
Example
dGcDistance = sis.MeasureGreatCircle (27.85, 39.53, 0, 34.11, 36.75, 0, "OGC.WGS_1984")
returns a floating point number representing the great circle distance in metres from 39.53°N, 27.85°W to 36.75°N, 34.11°W within the WGS 84 geodetic datum.
dGcDistance = sis.MeasureGreatCircle (134200, 25380, 0, 340598, 973180, 0, "OGC.OSGB_1936")
returns a floating point number representing the great circle distance in metres from Land’s End to John o’ Groats within the OSGB 1936 geodetic datum.