21 return ((0 <= diff) && (diff < range))
23 : (value - range * floor(diff / range));
29 return wrap_periodic<T>(
x,
T(0),
T(2 *
M_PI));
45 T tmpTht = std::fmod(theta, 2 *
M_PI);
48 }
else if (tmpTht < 0) {
51 tmpPhi = tmpPhi >
M_PI ? tmpPhi - 2 *
M_PI : tmpPhi;
54 tmpTht = 2 *
M_PI - tmpTht;
56 tmpPhi = tmpPhi >
M_PI ? (tmpPhi - 2 *
M_PI) : tmpPhi;
59 return std::pair<T, T>(tmpPhi, tmpTht);