2 namespace frechet {
namespace fs {
5 using namespace numeric;
7 template<
typename Float>
16 a = euclidean_distance_sq<Float>(q,r);
34 b = 2.0 * ((qx - px) * (rx - qx) + (qy - py) * (ry - qy));
35 c = euclidean_distance_sq<Float>(p,q) - sq<Float>(epsilon);
37 d =
sq(b) - 4.0 * a * c;
39 if (d < 0.0 || a==0.0) {
44 Float sqrtd = sqrt<Float>(d);
45 result.
lower() = (double)((-b - sqrtd) / (2.0*a));
46 result.
upper() = (double)((-b + sqrtd) / (2.0*a));
static const Interval INVALID
an invalid interval (contains NAN values)
global definitions for all algorithms.
static void calculateFreeSpaceSegment(const Point &p, const Point &q, const Point &r, double epsilon, data::Interval &result)
compute intervals for one point and segment. As parameters we expect a point on one curve (P,...
bool empty() const
empty test
QPointF Point
a point in the plane; with double floating point precision. This type is heavily used throughout all ...
static const Interval UNIT
the unit interval [0,1]
Number sq(const Number &x)
square function template for arbitrary number types
an interval of two double values.