PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ lw_seg_interact()

static int lw_seg_interact ( const POINT2D p1,
const POINT2D p2,
const POINT2D q1,
const POINT2D q2 
)
static

Definition at line 337 of file lwalgorithm.c.

References FP_GT, FP_LT, FP_MAX, FP_MIN, LW_FALSE, LW_TRUE, POINT2D::x, and POINT2D::y.

Referenced by lw_segment_intersects().

338 {
339  double minq=FP_MIN(q1->x,q2->x);
340  double maxq=FP_MAX(q1->x,q2->x);
341  double minp=FP_MIN(p1->x,p2->x);
342  double maxp=FP_MAX(p1->x,p2->x);
343 
344  if (FP_GT(minp,maxq) || FP_LT(maxp,minq))
345  return LW_FALSE;
346 
347  minq=FP_MIN(q1->y,q2->y);
348  maxq=FP_MAX(q1->y,q2->y);
349  minp=FP_MIN(p1->y,p2->y);
350  maxp=FP_MAX(p1->y,p2->y);
351 
352  if (FP_GT(minp,maxq) || FP_LT(maxp,minq))
353  return LW_FALSE;
354 
355  return LW_TRUE;
356 }
#define FP_MIN(A, B)
double x
Definition: liblwgeom.h:330
#define LW_FALSE
Definition: liblwgeom.h:76
#define FP_GT(A, B)
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
double y
Definition: liblwgeom.h:330
#define FP_LT(A, B)
#define FP_MAX(A, B)
Here is the caller graph for this function: