feat(numerics): add the mathematical constant tool
This commit is contained in:
parent
987299f9b5
commit
f60bd0e3e4
40
Redcraft.Utility/Source/Public/Numerics/Numbers.h
Normal file
40
Redcraft.Utility/Source/Public/Numerics/Numbers.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreTypes.h"
|
||||||
|
#include "TypeTraits/TypeTraits.h"
|
||||||
|
|
||||||
|
NAMESPACE_REDCRAFT_BEGIN
|
||||||
|
NAMESPACE_MODULE_BEGIN(Redcraft)
|
||||||
|
NAMESPACE_MODULE_BEGIN(Utility)
|
||||||
|
|
||||||
|
NAMESPACE_BEGIN(Math)
|
||||||
|
|
||||||
|
template <CFloatingPoint T>
|
||||||
|
struct TConstant
|
||||||
|
{
|
||||||
|
static constexpr T E = static_cast<T>(2.71828182845904523536028747135266249775724709369995);
|
||||||
|
static constexpr T Log2E = static_cast<T>(1.44269504088896340735992468100189213742664595415299);
|
||||||
|
static constexpr T Log10E = static_cast<T>(0.43429448190325182765112891891660508229439700580367);
|
||||||
|
static constexpr T Pi = static_cast<T>(3.14159265358979323846264338327950288419716939937511);
|
||||||
|
static constexpr T HalfPi = static_cast<T>(1.57079632679489661923132169163975144209858469968756);
|
||||||
|
static constexpr T TwoPi = static_cast<T>(6.28318530717958647692528676655900576839433879875022);
|
||||||
|
static constexpr T SquaredPi = static_cast<T>(9.86960440108935861883449099987615113531369940724079);
|
||||||
|
static constexpr T InvPi = static_cast<T>(0.31830988618379067153776752674502872406891929148091);
|
||||||
|
static constexpr T InvSqrtPi = static_cast<T>(0.56418958354775628694807945156077258584405062932900);
|
||||||
|
static constexpr T Ln2 = static_cast<T>(0.69314718055994530941723212145817656807550013436026);
|
||||||
|
static constexpr T Ln10 = static_cast<T>(2.30258509299404568401799145468436420760110148862877);
|
||||||
|
static constexpr T Sqrt2 = static_cast<T>(1.41421356237309504880168872420969807856967187537694);
|
||||||
|
static constexpr T Sqrt3 = static_cast<T>(1.73205080756887729352744634150587236694280525381038);
|
||||||
|
static constexpr T InvSqrt2 = static_cast<T>(0.70710678118654752440084436210484903928483593768847);
|
||||||
|
static constexpr T InvSqrt3 = static_cast<T>(0.57735026918962576450914878050195745564760175127013);
|
||||||
|
static constexpr T HalfSqrt2 = static_cast<T>(0.70710678118654752440084436210484903928483593768847);
|
||||||
|
static constexpr T HalfSqrt3 = static_cast<T>(0.86602540378443864676372317075293618347140262690519);
|
||||||
|
static constexpr T EGamma = static_cast<T>(0.57721566490153286060651209008240243104215933593992);
|
||||||
|
static constexpr T GoldenRatio = static_cast<T>(1.61803398874989484820458683436563811772030917980576);
|
||||||
|
};
|
||||||
|
|
||||||
|
NAMESPACE_END(Math)
|
||||||
|
|
||||||
|
NAMESPACE_MODULE_END(Utility)
|
||||||
|
NAMESPACE_MODULE_END(Redcraft)
|
||||||
|
NAMESPACE_REDCRAFT_END
|
Loading…
Reference in New Issue
Block a user