Calculate a bearing (azimuth) given a source and destination point.
Calculate the bearing between two points on a spheroid.
https://accesd.desjardins.ca/coast*
- Parameters
-
| r | - location of first point. |
| s | - location of second point. |
| spheroid | - spheroid definition. |
- Returns
- azimuth - azimuth in radians.
Definition at line 2032 of file lwgeodetic.c.
2033{
2035 double x1, y1, x2, y2, az;
2036
2037
2041
2042
2046
2047
2049 {
2051 }
2052
2053
2055
2056 return az < -0 ? 2*M_PI + az : az;
2057
2058}
double lwpoint_get_x(const LWPOINT *point)
double lwpoint_get_y(const LWPOINT *point)
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
double spheroid_direction(const GEOGRAPHIC_POINT *r, const GEOGRAPHIC_POINT *s, const SPHEROID *spheroid)
Computes the forward azimuth of the geodesic joining two points on the spheroid, using the inverse ge...
Point in spherical coordinates on the world.
References FP_EQUALS, geographic_point_init(), lwpoint_get_x(), lwpoint_get_y(), NAN, r, s, and spheroid_direction().
Referenced by geography_azimuth(), and lwgeom_project_spheroid_lwpoint().