36 #define _USE_MATH_DEFINES
45 #define M_PI 3.14159265358979323846264338327
50 const double PI_3div4 = 3 * M_PI / 4;
51 const double PI_div2 = 1.57079632679489661923;
52 const double EPSILON = 1e-12;
54 enum Orientation { CW, CCW, COLLINEAR };
68 double detleft = (pa.x - pc.x) * (pb.y - pc.y);
69 double detright = (pa.y - pc.y) * (pb.x - pc.x);
70 double val = detleft - detright;
71 if (val > -EPSILON && val < EPSILON) {
113 bool InScanArea(
const Point& pa,
const Point& pb,
const Point& pc,
const Point& pd)
115 double oadb = (pa.x - pb.x)*(pd.y - pb.y) - (pd.x - pb.x)*(pa.y - pb.y);
116 if (oadb >= -EPSILON) {
120 double oadc = (pa.x - pc.x)*(pd.y - pc.y) - (pd.x - pc.x)*(pa.y - pc.y);
121 if (oadc <= EPSILON) {
Sweep-line, Constrained Delauney Triangulation (CDT) See: Domiter, V.
Definition: shapes.cpp:36
Orientation Orient2d(const Point &pa, const Point &pb, const Point &pc)
Forumla to calculate signed area Positive if CCW Negative if CW 0 if collinear
Definition: utils.h:66