updated InScanArea

This commit is contained in:
Mason Green 2012-02-04 15:49:38 -05:00
parent 18b147311d
commit 6550d6703e
2 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
#! /usr/bin/env python #! /usr/bin/env python
# encoding: utf-8 # encoding: utf-8
# waf 1.6.2 # waf 1.6.10
VERSION='0.3.3' VERSION='0.3.3'
import sys import sys