PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ lw_pt_in_seg()

int lw_pt_in_seg ( const POINT2D P,
const POINT2D A1,
const POINT2D A2 
)

Returns true if P is between A1/A2.

Only makes sense if P has already been deterined to be on the line defined by A1/A2.

Definition at line 93 of file lwalgorithm.c.

94 {
95  return ((A1->x <= P->x && P->x < A2->x) || (A1->x >= P->x && P->x > A2->x)) ||
96  ((A1->y <= P->y && P->y < A2->y) || (A1->y >= P->y && P->y > A2->y));
97 }
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390

References POINT2D::x, and POINT2D::y.

Referenced by lw_dist2d_seg_arc(), ptarray_contains_point_partial(), and rect_leaf_node_segment_side().

Here is the caller graph for this function: