PostGIS  2.5.7dev-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.

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 LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
#define FP_LT(A, B)
#define FP_MAX(A, B)
#define FP_MIN(A, B)
#define FP_GT(A, B)
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331

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

Referenced by lw_segment_intersects().

Here is the caller graph for this function: