1 #ifndef GeometryVector_Geom_Phi_h 2 #define GeometryVector_Geom_Phi_h 28 template <
typename T1,
typename Range>
31 template <
typename T1>
36 value = std::fmod(value, static_cast<T1>(
twoPi()));
45 template <
typename T1>
51 template <
typename T1,
typename Range = MinusPiToPi>
63 Phi(
const T1&
val) : theValue(val) { normalize(theValue); }
66 operator T1()
const {
return theValue; }
69 template <
typename T2,
typename Range1>
75 T1
value()
const {
return theValue; }
78 T1
phi()
const {
return theValue; }
126 template <
typename T1,
typename Range>
132 template <
typename T1,
typename Range>
137 template <
typename T1,
typename Range,
typename Scalar>
142 template <
typename T1,
typename Range,
typename Scalar>
148 template <
typename T1,
typename Range>
153 template <
typename T1,
typename Range,
typename Scalar>
158 template <
typename T1,
typename Range,
typename Scalar>
164 template <
typename T1,
typename Range,
typename Scalar>
169 template <
typename T1,
typename Range>
175 template <
typename T1,
typename Range>
180 template <
typename T1,
typename Range>
186 template <
typename T>
T operator/(const OnePiRange< T > &a, const OnePiRange< T > &b)
Division.
bool nearEqual(const Phi< T1, Range > &angle, float tolerance=0.001) const
OnePiRange< T > operator-(const OnePiRange< T > &a)
bool nearZero(float tolerance=1.0_deg) const
void normalize(T1 &value)
static void normalize(T1 &value)
constexpr NumType convertRadToDeg(NumType radians)
T1 value() const
Explicit access to value in case implicit conversion not OK.
Phi & operator/=(const T1 &a)
Phi & operator+=(const Phi &a)
Phi & operator+=(const T1 &a)
Standard arithmetics.
OnePiRange< T > operator+(const OnePiRange< T > &a, const OnePiRange< T > &b)
Addition.
Abs< T >::type abs(const T &t)
Phi & operator-=(const T1 &a)
OnePiRange< T > operator*(const OnePiRange< T > &a, const Scalar &b)
Multiplication with scalar, does not change the precision.
Phi()
Default constructor does not initialise - just as double.
Phi & operator-=(const Phi &a)
constexpr valType make0To2pi(valType angle)
static void normalize(T1 &value)
Phi & operator*=(const T1 &a)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)