Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
constant.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace ph::math
7{
8
9namespace constant
10{
11
14template<typename T>
15inline constexpr T pi = T(
16 3.1415926535897932384626433832795028841971693993751058209749445923078164063);
17
20template<typename T>
21inline constexpr T rcp_pi = T(
22 0.3183098861837906715377675267450287240689192914809128974953346881177935953);
23
26template<typename T>
27inline constexpr T two_pi = T(
28 6.2831853071795864769252867665590057683943387987502116419498891846156328126);
29
32template<typename T>
33inline constexpr T rcp_two_pi = T(
34 0.1591549430918953357688837633725143620344596457404564487476673440588967976);
35
38template<typename T>
39inline constexpr T four_pi = T(
40 12.566370614359172953850573533118011536788677597500423283899778369231265625);
41
44template<typename T>
45inline constexpr T rcp_four_pi = T(
46 0.0795774715459476678844418816862571810172298228702282243738336720294483988);
47
50template<typename T>
51inline constexpr T pi2 = T(
52 9.8696044010893586188344909998761511353136994072407906264133493762200448224);
53
56template<typename T>
57inline constexpr T sqrt_2 = T(
58 1.4142135623730950488016887242096980785696718753769480731766797379907324785);
59
62template<typename T>
63inline constexpr T rcp_sqrt_2 = T(
64 0.7071067811865475244008443621048490392848359376884740365883398689953662392);
65
68template<typename T>
69inline constexpr T h_Planck = T(6.62607015e-34);
70
73template<typename T>
74inline constexpr T c_light = T(299792458);
75
76template<typename T>
77inline constexpr T k_Boltzmann = T(1.380649e-23);
78
79inline constexpr std::size_t KiB = 1024;
80inline constexpr std::size_t MiB = KiB * 1024;
81inline constexpr std::size_t GiB = MiB * 1024;
82inline constexpr std::size_t TiB = GiB * 1024;
83inline constexpr std::size_t PiB = TiB * 1024;
84
89inline constexpr std::size_t UNKNOWN_AXIS = static_cast<std::size_t>(-1);
90inline constexpr std::size_t X_AXIS = 0;
91inline constexpr std::size_t Y_AXIS = 1;
92inline constexpr std::size_t Z_AXIS = 2;
94
95}// end namespace constant
96
97}// end namespace ph::math
constexpr std::size_t Y_AXIS
Definition constant.h:91
constexpr std::size_t Z_AXIS
Definition constant.h:92
constexpr T rcp_pi
Value of .
Definition constant.h:21
constexpr T pi2
Value of .
Definition constant.h:51
constexpr std::size_t MiB
Definition constant.h:80
constexpr std::size_t GiB
Definition constant.h:81
constexpr std::size_t UNKNOWN_AXIS
Definition constant.h:89
constexpr T rcp_sqrt_2
Value of .
Definition constant.h:63
constexpr std::size_t X_AXIS
Definition constant.h:90
constexpr std::size_t PiB
Definition constant.h:83
constexpr T rcp_two_pi
Value of .
Definition constant.h:33
constexpr T four_pi
Value of .
Definition constant.h:39
constexpr T k_Boltzmann
Definition constant.h:77
constexpr T sqrt_2
Value of .
Definition constant.h:57
constexpr T c_light
Light speed in vacuum (SI units).
Definition constant.h:74
constexpr std::size_t TiB
Definition constant.h:82
constexpr T two_pi
Value of .
Definition constant.h:27
constexpr T rcp_four_pi
Value of .
Definition constant.h:45
constexpr T pi
Value of .
Definition constant.h:15
constexpr std::size_t KiB
Definition constant.h:79
constexpr T h_Planck
Planck's constant (SI units).
Definition constant.h:69
Math functions and utilities.
Definition TransformInfo.h:10