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.
789{
791 double vs_dot_vcp, vp_dot_vcp;
794
795 if ( vs.
x == -1.0 * ve.
x && vs.
y == -1.0 * ve.
y && vs.
z == -1.0 * ve.
z )
798
801
803 LWDEBUGF(4,
"vs_dot_vcp %.19g",vs_dot_vcp);
804
806 LWDEBUGF(4,
"vp_dot_vcp %.19g",vp_dot_vcp);
807
808 LWDEBUGF(4,
"fabs(vp_dot_vcp - vs_dot_vcp) %.39g",fabs(vp_dot_vcp - vs_dot_vcp));
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823 if ( vp_dot_vcp > vs_dot_vcp || fabs(vp_dot_vcp - vs_dot_vcp) < 2e-16 )
824 {
825 LWDEBUG(4,
"point is in cone");
827 }
828 LWDEBUG(4,
"point is not in cone");
830}
#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(), and edge_distance_to_point().