Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GeoUtils.CalculateBearing(GeoPoint, GeoPoint) Method

Computes an angle between the Geodetic North direction and a line given by two points, clockwise in degrees.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v24.2.dll

NuGet Package: DevExpress.Wpf.Map

#Declaration

public static double CalculateBearing(
    GeoPoint p1,
    GeoPoint p2
)

#Parameters

Name Type Description
p1 GeoPoint

The first geographical point.

p2 GeoPoint

The second geographical point.

#Returns

Type Description
Double

The bearing in degrees.

#Remarks

Note that the perpendicular line to the Geodetic North is plotted from the first point.

The code below calculates the bearing by two geographical points.

double bearing = GeoUtils.CalculateBearing(new GeoPoint(36.1, -115.1), new GeoPoint(35.9, -115.9));
See Also