PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ dot_product()

static double dot_product ( const POINT3D p1,
const POINT3D p2 
)
static

Convert cartesion coordinates on unit sphere to lon/lat coordinates static void cart2ll(const POINT3D *p, POINT2D *g) { g->x = longitude_degrees_normalize(180.0 * atan2(p->y, p->x) / M_PI); g->y = latitude_degrees_normalize(180.0 * asin(p->z) / M_PI); }.

Calculate the dot product of two unit vectors (-1 == opposite, 0 == orthogonal, 1 == identical)

Definition at line 442 of file lwgeodetic.c.

References POINT3D::x, POINT3D::y, and POINT3D::z.

Referenced by dot_product_side(), edge_calculate_gbox(), edge_distance_to_point(), edge_intersection(), edge_intersects(), edge_point_in_cone(), edge_point_side(), point_in_cone(), sphere_distance_cartesian(), unit_normal(), and vector_angle().

443 {
444  return (p1->x*p2->x) + (p1->y*p2->y) + (p1->z*p2->z);
445 }
double y
Definition: liblwgeom.h:340
double x
Definition: liblwgeom.h:340
double z
Definition: liblwgeom.h:340
Here is the caller graph for this function: