prg_geo_bearing_compute()
Abstract
Computes a bearing for the shortest path between source and destination along the earth's sphere.
Syntax
prg_geo_bearing_compute (source_lat, source_long, dest_lat, dest_long)
| Argument | Type | Description |
|---|---|---|
source_lat |
double |
latitude of the first point |
source_long |
double |
longitude of the first point |
dest_lat |
double |
latitude of the second point |
dest_long |
double |
longitude of the second point |
Return Type
double
Bearing from the first point to the second.
Header
prg_geo.h
Details
The return value is between 0.0 (inclusive) and 360.0 (exclusive). 0.0 is returned in the following situations:
- The bearing is north.
- The two points are the same.
- The two points are diametrically opposed (opposite sides of the earth).