~mir-team/mir/in-process-egl+input-conglomeration

« back to all changes in this revision

Viewing changes to 3rd_party/glm/glm/gtx/constants.inl

Merged trunk and fixed issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
///////////////////////////////////////////////////////////////////////////////////
2
 
/// OpenGL Mathematics (glm.g-truc.net)
3
 
///
4
 
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5
 
/// Permission is hereby granted, free of charge, to any person obtaining a copy
6
 
/// of this software and associated documentation files (the "Software"), to deal
7
 
/// in the Software without restriction, including without limitation the rights
8
 
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 
/// copies of the Software, and to permit persons to whom the Software is
10
 
/// furnished to do so, subject to the following conditions:
11
 
/// 
12
 
/// The above copyright notice and this permission notice shall be included in
13
 
/// all copies or substantial portions of the Software.
14
 
/// 
15
 
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 
/// THE SOFTWARE.
22
 
///
23
 
/// @ref gtx_constants
24
 
/// @file glm/gtx/constants.inl
25
 
/// @date 2011-10-14 / 2011-10-14
26
 
/// @author Christophe Riccio
27
 
///////////////////////////////////////////////////////////////////////////////////
28
 
 
29
 
namespace glm
30
 
{
31
 
        template <typename T>
32
 
        GLM_FUNC_QUALIFIER T epsilon()
33
 
        {
34
 
                return std::numeric_limits<T>::epsilon();
35
 
        }
36
 
 
37
 
        template <typename T>
38
 
        GLM_FUNC_QUALIFIER T zero()
39
 
        {
40
 
                return T(0);
41
 
        }
42
 
 
43
 
        template <typename T>
44
 
        GLM_FUNC_QUALIFIER T one()
45
 
        {
46
 
                return T(1);
47
 
        }
48
 
 
49
 
        template <typename T>
50
 
        GLM_FUNC_QUALIFIER T pi()
51
 
        {
52
 
                return T(3.14159265358979323846264338327950288);
53
 
        }
54
 
 
55
 
        template <typename T>
56
 
        GLM_FUNC_QUALIFIER T root_pi()
57
 
        {
58
 
                return T(1.772453850905516027);
59
 
        }
60
 
 
61
 
        template <typename T>
62
 
        GLM_FUNC_QUALIFIER T half_pi()
63
 
        {
64
 
                return T(1.57079632679489661923132169163975144);
65
 
        }
66
 
 
67
 
        template <typename T>
68
 
        GLM_FUNC_QUALIFIER T quarter_pi()
69
 
        {
70
 
                return T(0.785398163397448309615660845819875721);
71
 
        }
72
 
 
73
 
        template <typename T>
74
 
        GLM_FUNC_QUALIFIER T one_over_pi()
75
 
        {
76
 
                return T(0.318309886183790671537767526745028724);
77
 
        }
78
 
 
79
 
        template <typename T>
80
 
        GLM_FUNC_QUALIFIER T two_over_pi()
81
 
        {
82
 
                return T(0.636619772367581343075535053490057448);
83
 
        }
84
 
 
85
 
        template <typename T>
86
 
        GLM_FUNC_QUALIFIER T two_over_root_pi()
87
 
        {
88
 
                return T(1.12837916709551257389615890312154517);
89
 
        }
90
 
 
91
 
        template <typename T>
92
 
        GLM_FUNC_QUALIFIER T one_over_root_two()
93
 
        {
94
 
                return T(0.707106781186547524400844362104849039);
95
 
        }
96
 
 
97
 
        template <typename T>
98
 
        GLM_FUNC_QUALIFIER T root_half_pi()
99
 
        {
100
 
                return T(1.253314137315500251);
101
 
        }
102
 
 
103
 
        template <typename T>
104
 
        GLM_FUNC_QUALIFIER T root_two_pi()
105
 
        {
106
 
                return T(2.506628274631000502);
107
 
        }
108
 
 
109
 
        template <typename T>
110
 
        GLM_FUNC_QUALIFIER T root_ln_four()
111
 
        {
112
 
                return T(1.17741002251547469);
113
 
        }
114
 
 
115
 
        template <typename T>
116
 
        GLM_FUNC_QUALIFIER T e()
117
 
        {
118
 
                return T(2.71828182845904523536);
119
 
        }
120
 
 
121
 
        template <typename T>
122
 
        GLM_FUNC_QUALIFIER T euler()
123
 
        {
124
 
                return T(0.577215664901532860606);
125
 
        }
126
 
 
127
 
        template <typename T>
128
 
        GLM_FUNC_QUALIFIER T root_two()
129
 
        {
130
 
                return T(1.41421356237309504880168872420969808);
131
 
        }
132
 
 
133
 
        template <typename T>
134
 
        GLM_FUNC_QUALIFIER T root_three()
135
 
        {
136
 
                return T(1.73205080756887729352744634150587236);
137
 
        }
138
 
 
139
 
        template <typename T>
140
 
        GLM_FUNC_QUALIFIER T root_five()
141
 
        {
142
 
                return T(2.23606797749978969640917366873127623);
143
 
        }
144
 
 
145
 
        template <typename T>
146
 
        GLM_FUNC_QUALIFIER T ln_two()
147
 
        {
148
 
                return T(0.693147180559945309417232121458176568);
149
 
        }
150
 
 
151
 
        template <typename T>
152
 
        GLM_FUNC_QUALIFIER T ln_ten()
153
 
        {
154
 
                return T(2.30258509299404568401799145468436421);
155
 
        }
156
 
 
157
 
        template <typename T>
158
 
        GLM_FUNC_QUALIFIER T ln_ln_two()
159
 
        {
160
 
                return T(-0.3665129205816643);
161
 
        }
162
 
 
163
 
        template <typename T>
164
 
        GLM_FUNC_QUALIFIER T third()
165
 
        {
166
 
                return T(0.3333333333333333333333333333333333333333);
167
 
        }
168
 
 
169
 
        template <typename T>
170
 
        GLM_FUNC_QUALIFIER T two_thirds()
171
 
        {
172
 
                return T(0.666666666666666666666666666666666666667);
173
 
        }
174
 
 
175
 
        template <typename T>
176
 
        GLM_FUNC_QUALIFIER T golden_ratio()
177
 
        {
178
 
                return T(1.61803398874989484820458683436563811);
179
 
        }
180
 
} //namespace glm