PostGIS  2.5.7dev-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 721 of file lwgeodetic.c.

722 {
723  POINT3D normal1, normal2;
724  robust_cross_product(b, a, &normal1);
725  robust_cross_product(b, c, &normal2);
726  normalize(&normal1);
727  normalize(&normal2);
728  return sphere_distance_cartesian(&normal1, &normal2);
729 }
void normalize(POINT3D *p)
Normalize to a unit vector.
Definition: lwgeodetic.c:615
double sphere_distance_cartesian(const POINT3D *s, const POINT3D *e)
Given two unit vectors, calculate their distance apart in radians.
Definition: lwgeodetic.c:967
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:634

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

Referenced by sphere_signed_area().

Here is the call graph for this function:
Here is the caller graph for this function: