Not Enough Math
Lightweight zero-dependency C++ math library
Loading...
Searching...
No Matches
consts.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4
5namespace nem
6{
7 template <std::floating_point T> constexpr T SQRT2 = (T)1.414213562373095;
8 template <std::floating_point T> constexpr T SQRT3 = (T)1.73205080756887;
9 template <std::floating_point T> constexpr T SQRT5 = (T)2.236067977499789;
10 template <std::floating_point T> constexpr T PI = (T)3.141592653589793;
11 template <std::floating_point T> constexpr T HALF_PI = (T)nem::PI<T> * (T)0.5;
12 template <std::floating_point T> constexpr T QUARTER_PI = (T)nem::PI<T> * (T)0.25;
13 template <std::floating_point T> constexpr T TWO_PI = (T)nem::PI<T> * (T)2.0;
14 template <std::floating_point T> constexpr T E = (T)2.718281828459045;
15 template <std::floating_point T> constexpr T ESQR = nem::E<T> * nem::E<T>;
16 template <std::floating_point T> constexpr T PHI = (T)1.618033988749894;
17 template <std::floating_point T> constexpr T DEG_TO_RAD = nem::TWO_PI<T> / (T)360.0;
18 template <std::floating_point T> constexpr T RAD_TO_DEG = (T)1.0 / nem::DEG_TO_RAD<T>;
19 template <std::floating_point T> constexpr T LN2 = (T)0.6931471805599453094;
20
22 template <std::floating_point T> constexpr T LOG2E = (T)1.44269504088896340735992;
23}
Definition config.hpp:16
constexpr T QUARTER_PI
Definition consts.hpp:12
constexpr T TWO_PI
Definition consts.hpp:13
constexpr T LOG2E
log(2, e)
Definition consts.hpp:22
constexpr T SQRT2
Definition consts.hpp:7
constexpr T PI
Definition consts.hpp:10
constexpr T LN2
Definition consts.hpp:19
constexpr T RAD_TO_DEG
Definition consts.hpp:18
constexpr T SQRT3
Definition consts.hpp:8
constexpr T HALF_PI
Definition consts.hpp:11
constexpr T SQRT5
Definition consts.hpp:9
constexpr T ESQR
Definition consts.hpp:15
constexpr T DEG_TO_RAD
Definition consts.hpp:17
constexpr T PHI
Definition consts.hpp:16
constexpr T E
Definition consts.hpp:14