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.
3542{
3544 double ab_dot;
3545 int a1_side, a2_side, b1_side, b2_side;
3547
3548
3551
3552
3554
3556 {
3557
3560 {
3563 }
3564 return rv;
3565 }
3566
3567
3568
3573
3574
3575 if ( a1_side == a2_side && a1_side != 0 )
3576 {
3577
3579 }
3580
3581
3582 if ( b1_side == b2_side && b1_side != 0 )
3583 {
3584
3586 }
3587
3588
3589 if ( a1_side != a2_side && (a1_side + a2_side) == 0 &&
3590 b1_side != b2_side && (b1_side + b2_side) == 0 )
3591 {
3592
3595 {
3597 }
3598
3599
3602 {
3604 }
3605
3607 }
3608
3609
3611
3612
3613 if ( a1_side == 0 )
3614 {
3615
3617 }
3618 else if ( a2_side == 0 )
3619 {
3620
3622 }
3623
3624
3625 if ( b1_side == 0 )
3626 {
3627
3629 }
3630 else if ( b2_side == 0 )
3631 {
3632
3634 }
3635
3636 return rv;
3637}
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.