39 double dx = pp->
x - qp->
x;
40 double dy = pp->
y - qp->
y;
42 return (dx * dx + dy * dy);
59 return ((a.
y - b.
y) * (c.
x - b.
x) - (c.
y - b.
y) * (a.
x - b.
x));
64 return (
area_2(a, b, c) > 0);
74 b.
x * (c.
y - d.
y) + d.
x * (b.
y - a.
y) + c.
x * (a.
y - b.
y);
81 s = (a.
x * (d.
y - c.
y) + c.
x * (a.
y - d.
y) + d.
x * (c.
y - a.
y)
83 t = -(a.
x * (c.
y - b.
y) + b.
x * (a.
y - c.
y) + c.
x * (b.
y - a.
y)
86 p->
x = a.
x + s * (b.
x - a.
x);
87 p->
y = a.
y + s * (b.
y - a.
y);
89 if ((0.0 <= s) && (s <= 1.0) && (0.0 <= t) && (t <= 1.0))
int leftOf(Point a, Point b, Point c)
double dist_2(Point *pp, Point *qp)
double area_2(Point a, Point b, Point c)
void addpt(Point *c, Point a, Point b)
void subpt(Point *a, Point b, Point c)
int intersection(Point a, Point b, Point c, Point d, Point *p)