PostGIS  2.2.8dev-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 322 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().

323 {
324  double minq=FP_MIN(q1->x,q2->x);
325  double maxq=FP_MAX(q1->x,q2->x);
326  double minp=FP_MIN(p1->x,p2->x);
327  double maxp=FP_MAX(p1->x,p2->x);
328 
329  if (FP_GT(minp,maxq) || FP_LT(maxp,minq))
330  return LW_FALSE;
331 
332  minq=FP_MIN(q1->y,q2->y);
333  maxq=FP_MAX(q1->y,q2->y);
334  minp=FP_MIN(p1->y,p2->y);
335  maxp=FP_MAX(p1->y,p2->y);
336 
337  if (FP_GT(minp,maxq) || FP_LT(maxp,minq))
338  return LW_FALSE;
339 
340  return LW_TRUE;
341 }
#define FP_MIN(A, B)
double x
Definition: liblwgeom.h:312
#define LW_FALSE
Definition: liblwgeom.h:62
#define FP_GT(A, B)
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
double y
Definition: liblwgeom.h:312
#define FP_LT(A, B)
#define FP_MAX(A, B)
Here is the caller graph for this function: