Internal class definitions to facilitate construction of diagram.
More...
#include <EventUtilities.h>
Internal class definitions to facilitate construction of diagram.
Definition at line 27 of file EventUtilities.h.
double voronoi2d::EventUtilities::computeArcVal |
( |
const double |
beachPos, |
|
|
const double |
yPos, |
|
|
const IEvent * |
arc |
|
) |
| const |
Definition at line 22 of file EventUtilities.cxx.
25 double arcVal = std::numeric_limits<double>::max();
26 double deltaxLx = arc->xPos() - beachPos;
28 if (
std::abs(deltaxLx) > std::numeric_limits<double>::epsilon())
30 double deltayPy = yPos - arc->yPos();
31 double sumPxLx = arc->xPos() + beachPos;
33 arcVal = 0.5 * (deltayPy * deltayPy / deltaxLx + sumPxLx);
double voronoi2d::EventUtilities::computeBreak |
( |
const double |
beachLinePos, |
|
|
const IEvent * |
leftArc, |
|
|
const IEvent * |
rightArc, |
|
|
RootsPair & |
roots |
|
) |
| const |
Definition at line 39 of file EventUtilities.cxx.
43 double lx = beachLinePos;
44 double deltaX1 = leftArc->xPos() - lx;
45 double deltaX2 = rightArc->xPos() - lx;
46 double breakPoint = -std::numeric_limits<double>::max();
49 if (
std::abs(deltaX1 - deltaX2) < std::numeric_limits<double>::epsilon()) breakPoint = 0.5 * (rightArc->yPos() + leftArc->yPos());
55 double p1x = leftArc->xPos();
56 double p1y = leftArc->yPos();
57 double p2x = rightArc->xPos();
58 double p2y = rightArc->yPos();
60 double b = 2. * (p2y * deltaX1 - p1y * deltaX2);
61 double c = deltaX2 * (p1y * p1y + deltaX1 * (p1x + lx)) - deltaX1 * (p2y * p2y + deltaX2 * (p2x + lx));
62 double radical = std::max(0.,b * b - 4. *
a * c);
64 if (radical > 0.) radical = sqrt(radical);
66 double rootPos = 0.5 * (-b + radical) /
a;
67 double rootNeg = 0.5 * (-b - radical) /
a;
69 roots.first = std::min(rootPos, rootNeg);
70 roots.second = std::max(rootPos, rootNeg);
76 if (p1x < p2x) breakPoint = roots.second;
77 else breakPoint = roots.first;
bool voronoi2d::EventUtilities::newSiteToLeft |
( |
const IEvent * |
newSite, |
|
|
const IEvent * |
leftArc, |
|
|
const IEvent * |
rightArc |
|
) |
| const |
Definition at line 83 of file EventUtilities.cxx.
90 double breakPoint =
computeBreak(newSite->xPos()-0.000001, leftArc, rightArc, roots);
92 return newSite->yPos() < breakPoint;
double computeBreak(const double, const IEvent *, const IEvent *, RootsPair &) const
std::pair< double, double > RootsPair
The documentation for this class was generated from the following files: