Utility functions to be used with angular quantities.
More...
#include <Angle.h>
|
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 | normalised (const double angle) |
| Normalise an angle to lie in the range from [-pi, pi].
|
|
static void | normalise (double &angle) |
| Normalise an angle inplace 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].
|
|
static double | reversed (const double angle) |
| Get the angle that point in the opposite direction.
|
|
Utility functions to be used with angular quantities.
All angles are normalised to be in the range [-pi, pi]
Definition at line 24 of file Angle.h.
◆ average()
static double average |
( |
const double | angle1, |
|
|
double | angle2 ) |
|
inlinestatic |
Combines two angular values to the one that lies half way between them on the short arc.
Definition at line 27 of file Angle.h.
28 {
29 return normalised(angle1 + normalised(angle2 - angle1) / 2);
30 }
◆ fullNormalised()
static double fullNormalised |
( |
const double | angle | ) |
|
|
inlinestatic |
Normalise an angle to lie in the range from [-pi, pi].
Definition at line 48 of file Angle.h.
49 {
50 return std::remainder(angle, 2 * M_PI);
51 }
◆ normalise()
static void normalise |
( |
double & | angle | ) |
|
|
inlinestatic |
Normalise an angle inplace to lie in the range from [-pi, pi].
Definition at line 41 of file Angle.h.
42 {
43 if (angle > M_PI) angle -= 2 * M_PI;
44 if (angle < -M_PI) angle += 2 * M_PI;
45 }
◆ normalised()
static double normalised |
( |
const double | angle | ) |
|
|
inlinestatic |
Normalise an angle to lie in the range from [-pi, pi].
Definition at line 33 of file Angle.h.
34 {
35 if (angle > M_PI) return angle - 2 * M_PI;
36 if (angle < -M_PI) return angle + 2 * M_PI;
37 return angle;
38 }
◆ reversed()
static double reversed |
( |
const double | angle | ) |
|
|
inlinestatic |
Get the angle that point in the opposite direction.
Definition at line 54 of file Angle.h.
55 {
56 return angle > 0 ? angle - M_PI : angle + M_PI;
57 }
The documentation for this struct was generated from the following file:
- tracking/trackFindingCDC/numerics/include/Angle.h