AGI STK Objects 11 Send comments on this topic.
ComputeSurfaceDistance Method (IAgStkCentralBodyEllipsoid)
See Also  Example
StartLat
StartLon
EndLat
EndLon





Description

Computes the distance between two points on the surface of the central body. Distance is measured along a great arc path.

Syntax

[Visual Basic .NET]
Public Function ComputeSurfaceDistance( _
   ByVal StartLat As System.Object, _
   ByVal StartLon As System.Object, _
   ByVal EndLat As System.Object, _
   ByVal EndLon As System.Object _
) As Double

[C#]
public double ComputeSurfaceDistance(
System.Object StartLat,
System.Object StartLon,
System.Object EndLat,
System.Object EndLon
);

[Managed C++]
public: double ComputeSurfaceDistance(
VARIANT StartLat,
VARIANT StartLon,
VARIANT EndLat,
VARIANT EndLon
);

[Java]
public double computeSurfaceDistance(
Variant StartLat,
Variant StartLon,
Variant EndLat,
Variant EndLon
);

[Unmanaged C++]
public: HRESULT ComputeSurfaceDistance(
VARIANT StartLat,
VARIANT StartLon,
VARIANT EndLat,
VARIANT EndLon,
double * ReturnValue
);

Parameters

StartLat
StartLon
EndLat
EndLon

Example

Computes the distance between two locations.
[C#] Copy Code
IAgStkCentralBodyEllipsoid centralBodyEllipsoid = root.CentralBodies["Earth"].Ellipsoid; 
 
// Compute the distance between Philadelphia and London. 
// The code snippet assumes the latitude and longitude unit preference is set to degrees. 
double distance = centralBodyEllipsoid.ComputeSurfaceDistance(40.0068, -75.134751.4879, -0.1780); 
Console.WriteLine("The distance between Philadelphia and London is: {0}", distance); 
 

Computes the distance between two locations.
[Visual Basic .NET] Copy Code
Dim centralBodyEllipsoid As IAgStkCentralBodyEllipsoid = root.CentralBodies("Earth").Ellipsoid

' Compute the distance between Philadelphia and London.
' The code snippet assumes the latitude and longitude unit preference is set to degrees.
Dim distance As Double = centralBodyEllipsoid.ComputeSurfaceDistance(40.0068, -75.1347, 51.4879, -0.178)
Console.WriteLine("The distance between Philadelphia and London is: {0}", distance)

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1