Global Mapper SDK
GM_CalcBearing
Calculates the bearing in radians between two points.
Syntax
C++
Copy
GM_Error_t32 GM_CalcBearing
(
double aFromX, // IN: start X/longitude coordinate
double aFromY, // IN: start Y/latitude coordinate
double aToX, // IN: stop X/longitude coordinate
double aToY, // IN: stop Y/latitude coordinate
boolean aLatLon, // IN: TRUE - coordinates are lat/lon, FALSE - coordinates are in the current projection?
double* aBearing // OUT: bearing in radians between the points
);
Remarks
The points can either be specified as lat/lon values or in the current projection. The bearing retrieved is a cartographic bearing, with 0 being north, PI / 2 being east, PI being south, and 3 * PI / 2 being west.