32 #if defined(FrechetShortcut_RECURSES)
33 #error Recursive header files inclusion detected in FrechetShortcut.h
34 #else // defined(FrechetShortcut_RECURSES)
36 #define FrechetShortcut_RECURSES
38 #if !defined FrechetShortcut_h
40 #define FrechetShortcut_h
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConceptUtils.h"
46 #include "DGtal/kernel/PointVector.h"
47 #include "DGtal/arithmetic/IntegerComputer.h"
48 #include <boost/icl/interval_set.hpp>
53 #include "DGtal/geometry/curves/SegmentComputerUtils.h"
106 template <typename TIterator,typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
277 Cone(
double a0,
double a1);
284 Cone(
double x,
double y,
double x0,
double y0,
double x1,
double y1);
339 static bool isBetween(
double i,
double a,
double b,
double n)
386 double x1,
double y1,
double r1,
387 double *xi,
double *yi,
388 double *xi_prime,
double *yi_prime)
390 double a, dx, dy, d, h, rx, ry;
407 std::cerr <<
"Warning : the two circles do not intersect -> should never happen" << std::endl;
410 if (d < fabs(r0 - r1))
422 a = ((r0*r0) - (r1*r1) + (d*d)) / (2.0 * d) ;
425 x2 = x0 + (dx * a/d);
426 y2 = y0 + (dy * a/d);
431 h = sqrt((r0*r0) - (a*a));
461 static int circleTangentPoints(
double x,
double y,
double x1,
double y1,
double r1,
double *xi,
double *yi,
462 double *xi_prime,
double *yi_prime)
464 double x0 = (x+x1)/2;
465 double y0 = (y+y1)/2;
466 double r0 = sqrt((x-x1)*(x-x1) + (y-y1)*(y-y1))/2;
495 return atan(alpha)+2*
M_PI;
498 return atan(alpha)+
M_PI;
520 return acos((
double)ic.
dotProduct(u,v)/(u.norm()*v.norm()));
618 static int rot(
int d,
int quad)
700 void init(
const ConstIterator& it);
770 ConstIterator
begin()
const;
774 ConstIterator
end()
const;
908 template <
typename TIterator,
typename TInteger>
910 operator<< ( std::ostream & out, const FrechetShortcut<TIterator,TInteger> & object );
922 #include "DGtal/geometry/curves/FrechetShortcut.ih"
926 #endif // !defined FrechetShortcut_h
928 #undef FrechetShortcut_RECURSES
929 #endif // else defined(FrechetShortcut_RECURSES)