PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ sphere_angle()

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 671 of file lwgeodetic.c.

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

Referenced by sphere_signed_area().

672 {
673  POINT3D normal1, normal2;
674  robust_cross_product(b, a, &normal1);
675  robust_cross_product(b, c, &normal2);
676  normalize(&normal1);
677  normalize(&normal2);
678  return sphere_distance_cartesian(&normal1, &normal2);
679 }
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:584
void normalize(POINT3D *p)
Normalize to a unit vector.
Definition: lwgeodetic.c:565
double sphere_distance_cartesian(const POINT3D *s, const POINT3D *e)
Given two unit vectors, calculate their distance apart in radians.
Definition: lwgeodetic.c:917
Here is the call graph for this function:
Here is the caller graph for this function: