ArcGIS Pro 2.8 API Reference Guide
GeodesicDistance Method (IGeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > IGeometryEngine Interface : GeodesicDistance Method
The first geometry.
The second geometry.
Calculates the geodesic distance between two geometries.
Syntax
double GeodesicDistance( 
   Geometry geometry1,
   Geometry geometry2
)
Function GeodesicDistance( _
   ByVal geometry1 As Geometry, _
   ByVal geometry2 As Geometry _
) As Double

Parameters

geometry1
The first geometry.
geometry2
The second geometry.

Return Value

The geodesic distance between the two geometries in meters. If either of the input geometries is empty, then NaN is returned.
Exceptions
ExceptionDescription
Either geometry1 or geometry2 or both are null.
The method is not implemented for GeometryBag or Multipatch.
Incompatible spatial references between the input geometries.
Spatial reference of geometry1or geometry2is an image coordinate system.
Remarks
Geodesic distance is the shortest distance between two points on the surface of the Earth.
Example
var point1 = MapPointBuilder.CreateMapPoint(-170, 45, SpatialReferences.WGS84);
var point2 = MapPointBuilder.CreateMapPoint(170, 45, SpatialReferences.WGS84);

var distances_meters = GeometryEngine.Instance.GeodesicDistance(point1, point2);
// distance is approximately 1572912.2066940258 in meters
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

IGeometryEngine Interface
IGeometryEngine Members