Back to Devexpress

GeoUtils.CalculateBearing(GeoPoint, GeoPoint) Method

wpf-devexpress-dot-xpf-dot-map-dot-geoutils-dot-calculatebearing-x28-devexpress-dot-xpf-dot-map-dot-geopoint-devexpress-dot-xpf-dot-map-dot-geopoint-x29.md

latest1.9 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public static double CalculateBearing(
    GeoPoint p1,
    GeoPoint p2
)
vb
Public Shared Function CalculateBearing(
    p1 As GeoPoint,
    p2 As GeoPoint
) As Double

Parameters

NameTypeDescription
p1GeoPoint

The first geographical point.

| | p2 | GeoPoint |

The second geographical point.

|

Returns

TypeDescription
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.

csharp
double bearing = GeoUtils.CalculateBearing(new GeoPoint(36.1, -115.1), new GeoPoint(35.9, -115.9));
vb
Dim bearing As Double = GeoUtils.CalculateBearing(New GeoPoint(36.1, -115.1), New GeoPoint(35.9, -115.9))

See Also

GeoUtils Class

GeoUtils Members

DevExpress.Xpf.Map Namespace