PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ dot_product()

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

Convert cartesian 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 446 of file lwgeodetic.c.

447 {
448  return (p1->x*p2->x) + (p1->y*p2->y) + (p1->z*p2->z);
449 }
double z
Definition: liblwgeom.h:343
double x
Definition: liblwgeom.h:343
double y
Definition: liblwgeom.h:343

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().

Here is the caller graph for this function: