mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-06 06:09:54 +01:00
updated InScanArea
This commit is contained in:
parent
18b147311d
commit
6550d6703e
@ -68,6 +68,7 @@ Orientation Orient2d(Point& pa, Point& pb, Point& pc)
|
|||||||
return CW;
|
return CW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
|
bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
|
||||||
{
|
{
|
||||||
double pdx = pd.x;
|
double pdx = pd.x;
|
||||||
@ -99,6 +100,22 @@ bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
|
||||||
|
{
|
||||||
|
double oadb = (pa.x - pb.x)*(pd.y - pb.y) - (pd.x - pb.x)*(pa.y - pb.y);
|
||||||
|
if (oadb >= EPSILON) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
double oadc = (pa.x - pc.x)*(pd.y - pc.y) - (pd.x - pc.x)*(pa.y - pc.y);
|
||||||
|
if (oadc <= EPSILON) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user