PostGIS  2.5.0dev-r@@SVN_REVISION@@
int lw_segment_side ( const POINT2D p1,
const POINT2D p2,
const POINT2D q 
)

lw_segment_side()

Return -1 if point Q is left of segment P Return 1 if point Q is right of segment P Return 0 if point Q in on segment P

Definition at line 64 of file lwalgorithm.c.

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

Referenced by edge_calculate_gbox(), lw_arc_calculate_gbox_cartesian_2d(), lw_arc_length(), lw_arc_side(), lw_dist2d_arc_arc_concentric(), lw_pt_in_arc(), lw_segment_intersects(), lwarc_linearize(), pt_continues_arc(), pta_unstroke(), ptarray_contains_point_partial(), rect_tree_contains_point(), and test_lw_segment_side().

65 {
66  double side = ( (q->x - p1->x) * (p2->y - p1->y) - (p2->x - p1->x) * (q->y - p1->y) );
67  return SIGNUM(side);
68 }
double x
Definition: liblwgeom.h:327
double y
Definition: liblwgeom.h:327
#define SIGNUM(n)
Macro that returns: -1 if n < 0, 1 if n > 0, 0 if n == 0.

Here is the caller graph for this function: