PostGIS  2.4.9dev-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 717 of file lwgeodetic.c.

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

Referenced by sphere_signed_area().

718 {
719  POINT3D normal1, normal2;
720  robust_cross_product(b, a, &normal1);
721  robust_cross_product(b, c, &normal2);
722  normalize(&normal1);
723  normalize(&normal2);
724  return sphere_distance_cartesian(&normal1, &normal2);
725 }
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:630
void normalize(POINT3D *p)
Normalize to a unit vector.
Definition: lwgeodetic.c:611
double sphere_distance_cartesian(const POINT3D *s, const POINT3D *e)
Given two unit vectors, calculate their distance apart in radians.
Definition: lwgeodetic.c:963
Here is the call graph for this function:
Here is the caller graph for this function: