PostGIS  2.5.0dev-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 690 of file lwgeodetic.c.

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

Referenced by sphere_signed_area().

691 {
692  POINT3D normal1, normal2;
693  robust_cross_product(b, a, &normal1);
694  robust_cross_product(b, c, &normal2);
695  normalize(&normal1);
696  normalize(&normal2);
697  return sphere_distance_cartesian(&normal1, &normal2);
698 }
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:603
void normalize(POINT3D *p)
Normalize to a unit vector.
Definition: lwgeodetic.c:584
double sphere_distance_cartesian(const POINT3D *s, const POINT3D *e)
Given two unit vectors, calculate their distance apart in radians.
Definition: lwgeodetic.c:936
Here is the call graph for this function:
Here is the caller graph for this function: