PostGIS  2.5.0dev-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 336 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().

337 {
338  double minq=FP_MIN(q1->x,q2->x);
339  double maxq=FP_MAX(q1->x,q2->x);
340  double minp=FP_MIN(p1->x,p2->x);
341  double maxp=FP_MAX(p1->x,p2->x);
342 
343  if (FP_GT(minp,maxq) || FP_LT(maxp,minq))
344  return LW_FALSE;
345 
346  minq=FP_MIN(q1->y,q2->y);
347  maxq=FP_MAX(q1->y,q2->y);
348  minp=FP_MIN(p1->y,p2->y);
349  maxp=FP_MAX(p1->y,p2->y);
350 
351  if (FP_GT(minp,maxq) || FP_LT(maxp,minq))
352  return LW_FALSE;
353 
354  return LW_TRUE;
355 }
#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: