in iou.cpp line27-29,it is said:
if (abs(pp1^pp2) < EPS &&
pp1pp2 < EPS)
return true;
which from my point of view is |pp1||pp2|sin(pp1,pp2)<EPS and |pp1||pp2|*cos(pp1,pp2)<EPS.
but it doesnt mean that p is on p1p2.
why dont you use the value of cos/sin of pp1 and pp2 to judge if p in on line p1p2?