diff --git a/maths.hpp b/maths.hpp index 40389da6..62311612 100644 --- a/maths.hpp +++ b/maths.hpp @@ -193,16 +193,21 @@ to_radians [[gnu::pure]] (T degrees) } -//----------------------------------------------------------------------------- -constexpr float -to_radians [[gnu::pure]] (float degrees) { - return degrees / 180 * static_cast (PI_f); +//! Normalised sinc function +template +constexpr T +sincn [[gnu::pure]] (T x) +{ + return std::sin (constants::PI * x) / (constants::PI * x); } -constexpr double -to_radians [[gnu::pure]] (double degrees) { - return degrees / 180 * PI_d; +//! Unnormalised sinc function +template +constexpr T +sincu [[gnu::pure]] (T x) +{ + return std::sin (x) / x; }