PostGIS  2.3.7dev-r@@SVN_REVISION@@
static double sphere_angle ( const GEOGRAPHIC_POINT a,
const GEOGRAPHIC_POINT b,
const GEOGRAPHIC_POINT c 
)
static

Returns the angle in radians at point B of the triangle formed by A-B-C.

Definition at line 686 of file lwgeodetic.c.

References normalize(), robust_cross_product(), and sphere_distance_cartesian().

Referenced by sphere_signed_area().

687 {
688  POINT3D normal1, normal2;
689  robust_cross_product(b, a, &normal1);
690  robust_cross_product(b, c, &normal2);
691  normalize(&normal1);
692  normalize(&normal2);
693  return sphere_distance_cartesian(&normal1, &normal2);
694 }
void robust_cross_product(const GEOGRAPHIC_POINT *p, const GEOGRAPHIC_POINT *q, POINT3D *a)
Computes the cross product of two vectors using their lat, lng representations.
Definition: lwgeodetic.c:599
void normalize(POINT3D *p)
Normalize to a unit vector.
Definition: lwgeodetic.c:580
double sphere_distance_cartesian(const POINT3D *s, const POINT3D *e)
Given two unit vectors, calculate their distance apart in radians.
Definition: lwgeodetic.c:932

Here is the call graph for this function:

Here is the caller graph for this function: