Returns true if the point p is inside the cone defined by the two ends of the edge e.
Definition at line 788 of file lwgeodetic.c.
791 double vs_dot_vcp, vp_dot_vcp;
795 if ( vs.
x == -1.0 * ve.
x && vs.
y == -1.0 * ve.
y && vs.
z == -1.0 * ve.
z )
803 LWDEBUGF(4,
"vs_dot_vcp %.19g",vs_dot_vcp);
806 LWDEBUGF(4,
"vp_dot_vcp %.19g",vp_dot_vcp);
808 LWDEBUGF(4,
"fabs(vp_dot_vcp - vs_dot_vcp) %.39g",fabs(vp_dot_vcp - vs_dot_vcp));
823 if ( vp_dot_vcp > vs_dot_vcp || fabs(vp_dot_vcp - vs_dot_vcp) < 2e-16 )
825 LWDEBUG(4,
"point is in cone");
828 LWDEBUG(4,
"point is not in cone");
#define LW_TRUE
Return types for functions with status returns.
void normalize(POINT3D *p)
Normalize to a unit vector.
static double dot_product(const POINT3D *p1, const POINT3D *p2)
Convert cartesian coordinates on unit sphere to lon/lat coordinates static void cart2ll(const POINT3D...
void vector_sum(const POINT3D *a, const POINT3D *b, POINT3D *n)
Calculate the sum of two vectors.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
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().