Returns true if the point p is inside the cone defined by the two ends of the edge e.
Definition at line 784 of file lwgeodetic.c.
References dot_product(), GEOGRAPHIC_EDGE::end, geog2cart(), LW_FALSE, LW_TRUE, LWDEBUG, LWDEBUGF, normalize(), GEOGRAPHIC_EDGE::start, vector_sum(), POINT3D::x, POINT3D::y, and POINT3D::z.
Referenced by edge_contains_point().
787 double vs_dot_vcp, vp_dot_vcp;
791 if ( vs.
x == -1.0 * ve.
x && vs.
y == -1.0 * ve.
y && vs.
z == -1.0 * ve.
z )
799 LWDEBUGF(4,
"vs_dot_vcp %.19g",vs_dot_vcp);
802 LWDEBUGF(4,
"vp_dot_vcp %.19g",vp_dot_vcp);
804 LWDEBUGF(4,
"fabs(vp_dot_vcp - vs_dot_vcp) %.39g",fabs(vp_dot_vcp - vs_dot_vcp));
819 if ( vp_dot_vcp > vs_dot_vcp || fabs(vp_dot_vcp - vs_dot_vcp) < 2e-16 )
821 LWDEBUG(4,
"point is in cone");
824 LWDEBUG(4,
"point is not in cone");
void normalize(POINT3D *p)
Normalize to a unit vector.
#define LWDEBUG(level, msg)
static double dot_product(const POINT3D *p1, const POINT3D *p2)
Convert cartesion coordinates on unit sphere to lon/lat coordinates static void cart2ll(const POINT3D...
#define LW_TRUE
Return types for functions with status returns.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesion coordinates on unit sphere.
void vector_sum(const POINT3D *a, const POINT3D *b, POINT3D *n)
Calculate the sum of two vectors.
#define LWDEBUGF(level, msg,...)