17 namespace TrackFindingCDC {
27 static double average(
const double angle1,
double angle2)
35 if (angle > M_PI)
return angle - 2 * M_PI;
36 if (angle < -M_PI)
return angle + 2 * M_PI;
43 if (angle > M_PI) angle -= 2 * M_PI;
44 if (angle < -M_PI) angle += 2 * M_PI;
50 return std::remainder(angle, 2 * M_PI);
56 return angle > 0 ? angle - M_PI : angle + M_PI;
Abstract base class for different kinds of events.
Utility functions to be used with angular quantities.
static void normalise(double &angle)
Normalise an angle inplace to lie in the range from [-pi, pi].
static double average(const double angle1, double angle2)
Combines two angular values to the one that lies half way between them on the short arc.
static double reversed(const double angle)
Get the angle that point in the opposite direction.
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].
static double fullNormalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].