Returns non-zero if edges A and B interact.
The type of interaction is given in the return value with the bitmask elements defined above.
Definition at line 3525 of file lwgeodetic.c.
References dot_product(), dot_product_side(), FP_EQUALS, PIR_A_TOUCH_LEFT, PIR_A_TOUCH_RIGHT, PIR_B_TOUCH_LEFT, PIR_B_TOUCH_RIGHT, PIR_COLINEAR, PIR_INTERSECTS, PIR_NO_INTERACT, point_in_cone(), unit_normal(), and vector_scale().
Referenced by circ_tree_contains_point(), circ_tree_distance_tree_internal(), lwpoly_intersects_line(), ptarray_contains_point_sphere(), ptarray_distance_spheroid(), and test_edge_intersects().
3529 int a1_side, a2_side, b1_side, b2_side;
3559 if ( a1_side == a2_side && a1_side != 0 )
3566 if ( b1_side == b2_side && b1_side != 0 )
3573 if ( a1_side != a2_side && (a1_side + a2_side) == 0 &&
3574 b1_side != b2_side && (b1_side + b2_side) == 0 )
3602 else if ( a2_side == 0 )
3614 else if ( b2_side == 0 )
#define PIR_B_TOUCH_RIGHT
#define PIR_A_TOUCH_RIGHT
static int dot_product_side(const POINT3D *p, const POINT3D *q)
Utility function for edge_intersects(), signum with a tolerance in determining if the value is zero...
void unit_normal(const POINT3D *P1, const POINT3D *P2, POINT3D *normal)
Calculates the unit normal to two vectors, trying to avoid problems with over-narrow or over-wide cas...
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...
static int point_in_cone(const POINT3D *A1, const POINT3D *A2, const POINT3D *P)
Utility function for checking if P is within the cone defined by A1/A2.
#define PIR_NO_INTERACT
Bitmask elements for edge_intersects() return value.
void vector_scale(POINT3D *n, double scale)
Scale a vector out by a factor.