ArcGIS Pro 2.9 API Reference Guide
ConstructGeodeticLineFromPoints Method (IGeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > IGeometryEngine Interface : ConstructGeodeticLineFromPoints Method
The type of geodetic curve to be created.
The from point.
The to point.
The linear unit of the densifyParameter if the densifyMode is DensifyByLength. If this is null, the units are assumed to be meters.
The densification mode.
The densification parameter.
Constructs a geodetic line connecting the specified points.
Syntax

Parameters

curveType
The type of geodetic curve to be created.
fromPoint
The from point.
toPoint
The to point.
linearUnit
The linear unit of the densifyParameter if the densifyMode is DensifyByLength. If this is null, the units are assumed to be meters.
densifyMode
The densification mode.
densifyParameter
The densification parameter.

Return Value

Returns the created geodetic line.
Exceptions
ExceptionDescription
Either fromPoint or toPoint is null.
Either fromPoint or toPoint is empty.
densifyParameter cannot be NaN.
esriCurveDensifyMethod.ByAngle is not supported.
Remarks
If the densifyMode is DensifyByLength, then the densifyParameter specifies the maximum segment length.

If the densifyMode is DensifyByDeviation, then it is the maximum distance from the true geodetic line to the densified output.

Example
var sr = SpatialReferenceBuilder.CreateSpatialReference(4326);

var pt1 = MapPointBuilderEx.CreateMapPoint(60, 180, sr);
var pt2 = MapPointBuilderEx.CreateMapPoint(60, 0, sr);

// densify by length
var gl = GeometryEngine.Instance.ConstructGeodeticLineFromPoints(GeodeticCurveType.Geodesic, pt1, pt2, null, esriCurveDensifyMethod.ByLength, -3.356);

// densify by deviation
gl = GeometryEngine.Instance.ConstructGeodeticLineFromPoints(GeodeticCurveType.Geodesic, pt1, pt2, null, esriCurveDensifyMethod.ByDeviation, -0.0026);
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

IGeometryEngine Interface
IGeometryEngine Members