30 const double dx = pp.
x - qp.
x;
31 const double dy = pp.
y - qp.
y;
50 return ((a.
y - b.
y) * (c.
x - b.
x) - (c.
y - b.
y) * (a.
x - b.
x));
55 return (
area_2(a, b, c) > 0);
65 b.
x * (c.
y - d.
y) + d.
x * (b.
y - a.
y) + c.
x * (a.
y - b.
y);
72 s = (a.
x * (d.
y - c.
y) + c.
x * (a.
y - d.
y) + d.
x * (c.
y - a.
y)
74 t = -(a.
x * (c.
y - b.
y) + b.
x * (a.
y - c.
y) + c.
x * (b.
y - a.
y)
77 p->
x = a.
x +
s * (b.
x - a.
x);
78 p->
y = a.
y +
s * (b.
y - a.
y);
80 if ((0.0 <=
s) && (
s <= 1.0) && (0.0 <= t) && (t <= 1.0))
int leftOf(Point a, Point b, Point c)
void addpt(Point *c, Point a, Point b)
void subpt(Point *a, Point b, Point c)
double dist_2(Point pp, Point qp)
distance squared between two points
double area_2(Point a, Point b, Point c)