14#include "trg/trg/Point2D.h"
15#include "trg/cdc/HoughTransformationCircle.h"
26 const std::string& name)
40 const float r = (xReal * xReal + yReal * yReal) /
41 (2 * xReal * cos(x) + 2 * yReal * sin(x));
67 static const float PI2 = 2 * M_PI;
70 float d0 =
atan(- xReal / yReal);
71 if (d0 < 0) d0 += PI2;
73 if (d1 > PI2) d1 -= PI2;
76 if ((x0 < d0) && (d0 < x1))
return true;
77 if ((x0 < d1) && (d1 < x1))
return true;
88 return diverge(xReal, yReal, x0, x1);
97 return diverge(xReal, yReal, x0, x1);
A class to represent a point in 2D.
double atan(double a)
atan for double
virtual TRGPoint2D circleCenter(const TRGPoint2D &) const
returns Point2D(phi, r) of a circle in real plane.
virtual TRGPoint2D convert(const TRGPoint2D &) const override
converts Point2D(phi, r) in real plane into Point2D(phi, r) in Hough plane.
virtual bool diverge(float xReal, float yReal, float x0, float x1) const override
returns true if Y diverges in given region.
virtual float y(float xReal, float yReal, float x) const override
returns Y coordinate in a Hough parameter plane.
virtual bool positiveDiverge(float xReal, float yReal, float x0, float x1) const override
returns true if Y diverges in given region.
TRGCDCHoughTransformationCircle(const std::string &name)
Contructor.
virtual ~TRGCDCHoughTransformationCircle()
Destructor.
virtual bool negativeDiverge(float xReal, float yReal, float x0, float x1) const override
returns true if Y diverges in given region.
Abstract base class for different kinds of events.