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 3540 of file lwgeodetic.c.
3544 int a1_side, a2_side, b1_side, b2_side;
3573 if ( a1_side == a2_side && a1_side != 0 )
3580 if ( b1_side == b2_side && b1_side != 0 )
3587 if ( a1_side != a2_side && (a1_side + a2_side) == 0 &&
3588 b1_side != b2_side && (b1_side + b2_side) == 0 )
3616 else if ( a2_side == 0 )
3628 else if ( b2_side == 0 )
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.
void vector_scale(POINT3D *n, double scale)
Scale a vector out by a factor.
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 cartesian coordinates on unit sphere to lon/lat coordinates static void cart2ll(const POINT3D...
#define PIR_A_TOUCH_RIGHT
#define PIR_B_TOUCH_RIGHT
#define PIR_NO_INTERACT
Bitmask elements for edge_intersects() return value.
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().