template<class T>
Magnum::Math::Constants struct

Numeric constants.

Public static functions

static auto pi() -> T constexpr
$ \pi $ .
static auto piHalf() -> T constexpr
Half of a $ \pi $ .
static auto piQuarter() -> T constexpr
Quarter of a $ \pi $ .
static auto tau() -> T constexpr
$ \tau $ .
static auto e() -> T constexpr
Euler's number.
static auto sqrt2() -> T constexpr
Square root of 2.
static auto sqrt3() -> T constexpr
Square root of 3.
static auto sqrtHalf() -> T constexpr
Square root of $ \frac{1}{2} $ .
static auto nan() -> T constexpr
Quiet NaN.
static auto inf() -> T constexpr
Positive $ \infty $ .

Function documentation

template<class T>
static T Magnum::Math::Constants<T>::pi() constexpr

$ \pi $ .

\[ \pi = 180 \degree \]

template<class T>
static T Magnum::Math::Constants<T>::piHalf() constexpr

Half of a $ \pi $ .

\[ \frac{\pi}{2} = 90 \degree \]

template<class T>
static T Magnum::Math::Constants<T>::piQuarter() constexpr

Quarter of a $ \pi $ .

\[ \frac{\pi}{4} = 45 \degree \]

template<class T>
static T Magnum::Math::Constants<T>::tau() constexpr

$ \tau $ .

Or two pi. See the Tau manifesto. If you think this is wrong, note that Python has it too.

\[ \tau = 2 \pi = 360 \degree \]

template<class T>
static T Magnum::Math::Constants<T>::e() constexpr

Euler's number.

\[ e = \ln (1) \]

template<class T>
static T Magnum::Math::Constants<T>::sqrt2() constexpr

Square root of 2.

\[ \sqrt{2} \]

template<class T>
static T Magnum::Math::Constants<T>::sqrt3() constexpr

Square root of 3.

\[ \sqrt{3} \]

template<class T>
static T Magnum::Math::Constants<T>::sqrtHalf() constexpr

Square root of $ \frac{1}{2} $ .

\[ \frac{\sqrt{2}}{2} = \frac{1}{\sqrt{2}} = \sin(45 \degree) = \cos(45 \degree) \]

template<class T>
static T Magnum::Math::Constants<T>::nan() constexpr

Quiet NaN.

template<class T>
static T Magnum::Math::Constants<T>::inf() constexpr

Positive $ \infty $ .