Cadcorp SIS API Methods

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:

  1. Transform (x1#,y1#,z1#) and (x2#,y2#,z2#) into the Geodetic Datum.

  2. Drop the two points onto the surface of the geodetic datum (i.e. ignore heights).

  3. Get the average latitude of the two points.

  4. Get the radius of the geodetic datum at the average latitude.

  5. Get the angle separating the two points in radians.

  6. 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 ME MD 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.


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).