1// tConstants.h 
2// 
3// Physical and mathematical constants. 
4// 
5// Copyright (c) 2004-2006, 2015, 2017, 2019, 2020 Tristan Grimmer. 
6// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby 
7// granted, provided that the above copyright notice and this permission notice appear in all copies. 
8// 
9// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 
10// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 
11// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 
12// AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 
13// PERFORMANCE OF THIS SOFTWARE. 
14 
15#pragma once 
16#include "Foundation/tPlatform.h" 
17namespace tMath 
18
19 
20 
21const float Pi = 3.14159265358979323f; // 180 degrees. 
22const float TwoPi = Pi * 2.0f; // 360 degrees. 
23const float PiOver2 = Pi / 2.0f; // 90 degrees. 
24const float PiOver3 = Pi / 3.0f; // 60 degrees. 
25const float PiOver4 = Pi / 4.0f; // 45 degrees; 
26const float PiOver6 = Pi / 6.0f; // 30 degrees; 
27const float DefaultGamma = 2.2f
28const float MaxFloat = 3.402823466e+38f
29 
30// This is a practical epsilon that can be used in many circumstances. One one millionth. 
31const float Epsilon = 0.000001f
32 
33// This is the smallest effective positive float such that 1.0f+EpsilonEff != 1.0f. 
34const float EpsilonEff = 1.192092896e-07f
35 
36// This is the smallest positive value that can be represented by a single precision floating point. 
37const float EpsilonRep = 1.175494351e-38f
38const float Infinity = MaxFloat
39 
40// The infinities below are not the special IEEE bit patterns that represent infinity. They are the very largest and 
41// smallest values that may be represented without use of the special bit patterns. 
42const float PosInfinity = MaxFloat
43const float NegInfinity = -MaxFloat
44 
45// C++11 should promote 2147483648 to long long int, but VS currently turns it into and unsigned int. That's why we're 
46// using the hex string literal representation for now. 
47const int32 MinInt32 = 0x80000000; // Decimal value -2147483648. 
48const int32 MaxInt32 = 2147483647; // Hex value 0x7FFFFFFF. 
49const uint32 MinUint32 = 0
50const uint32 MaxUint32 = 0xFFFFFFFF
51const uint32 MinUint16 = 0
52const uint32 MaxUint16 = 0xFFFF
53 
54 
55
56