diff --git a/include/omath/trigonometry/angle.hpp b/include/omath/trigonometry/angle.hpp index 4506e0c..131840f 100644 --- a/include/omath/trigonometry/angle.hpp +++ b/include/omath/trigonometry/angle.hpp @@ -70,31 +70,31 @@ namespace omath } [[nodiscard]] - Type sin() const noexcept + constexpr Type sin() const noexcept { return std::sin(as_radians()); } [[nodiscard]] - Type cos() const noexcept + constexpr Type cos() const noexcept { return std::cos(as_radians()); } [[nodiscard]] - Type tan() const noexcept + constexpr Type tan() const noexcept { return std::tan(as_radians()); } [[nodiscard]] - Type atan() const noexcept + constexpr Type atan() const noexcept { return std::atan(as_radians()); } [[nodiscard]] - Type cot() const noexcept + constexpr Type cot() const noexcept { return cos() / sin(); } diff --git a/include/omath/trigonometry/angles.hpp b/include/omath/trigonometry/angles.hpp index ce07dd8..dcb25e0 100644 --- a/include/omath/trigonometry/angles.hpp +++ b/include/omath/trigonometry/angles.hpp @@ -24,7 +24,7 @@ namespace omath::angles template requires std::is_floating_point_v - [[nodiscard]] Type horizontal_fov_to_vertical(const Type& horizontal_fov, const Type& aspect) noexcept + [[nodiscard]] constexpr Type horizontal_fov_to_vertical(const Type& horizontal_fov, const Type& aspect) noexcept { const auto fov_rad = degrees_to_radians(horizontal_fov); @@ -35,7 +35,7 @@ namespace omath::angles template requires std::is_floating_point_v - [[nodiscard]] Type vertical_fov_to_horizontal(const Type& vertical_fov, const Type& aspect) noexcept + [[nodiscard]] constexpr Type vertical_fov_to_horizontal(const Type& vertical_fov, const Type& aspect) noexcept { const auto fov_as_radians = degrees_to_radians(vertical_fov); @@ -47,7 +47,7 @@ namespace omath::angles template requires std::is_arithmetic_v - [[nodiscard]] Type wrap_angle(const Type& angle, const Type& min, const Type& max) noexcept + [[nodiscard]] constexpr Type wrap_angle(const Type& angle, const Type& min, const Type& max) noexcept { if (angle <= max && angle >= min) return angle;