master
ブランチ master
VulkanExample / dep / include / glm / exponential.hpp
5.6 KB、110行 生 Blame 履歴
1/// @ref core
2/// @file glm/exponential.hpp
3///
4/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
5///
6/// @defgroup core_func_exponential Exponential functions
7/// @ingroup core
8///
9/// Provides GLSL exponential functions
10///
11/// These all operate component-wise. The description is per component.
12///
13/// Include <glm/exponential.hpp> to use these core features.
14
15#pragma once
16
17#include "detail/type_vec1.hpp"
18#include "detail/type_vec2.hpp"
19#include "detail/type_vec3.hpp"
20#include "detail/type_vec4.hpp"
21#include <cmath>
22
23namespace glm
24{
25 /// @addtogroup core_func_exponential
26 /// @{
27
28 /// Returns 'base' raised to the power 'exponent'.
29 ///
30 /// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type qualifier.
31 /// @param exponent Floating point value representing the 'exponent'.
32 ///
33 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
34 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
35 template<length_t L, typename T, qualifier Q>
36 GLM_FUNC_DECL vec<L, T, Q> pow(vec<L, T, Q> const& base, vec<L, T, Q> const& exponent);
37
38 /// Returns the natural exponentiation of v, i.e., e^v.
39 ///
40 /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier.
41 /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
42 /// @tparam T Floating-point scalar types.
43 ///
44 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
45 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
46 template<length_t L, typename T, qualifier Q>
47 GLM_FUNC_DECL vec<L, T, Q> exp(vec<L, T, Q> const& v);
48
49 /// Returns the natural logarithm of v, i.e.,
50 /// returns the value y which satisfies the equation x = e^y.
51 /// Results are undefined if v <= 0.
52 ///
53 /// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier.
54 /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
55 /// @tparam T Floating-point scalar types.
56 ///
57 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
58 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
59 template<length_t L, typename T, qualifier Q>
60 GLM_FUNC_DECL vec<L, T, Q> log(vec<L, T, Q> const& v);
61
62 /// Returns 2 raised to the v power.
63 ///
64 /// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier.
65 /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
66 /// @tparam T Floating-point scalar types.
67 ///
68 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
69 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
70 template<length_t L, typename T, qualifier Q>
71 GLM_FUNC_DECL vec<L, T, Q> exp2(vec<L, T, Q> const& v);
72
73 /// Returns the base 2 log of x, i.e., returns the value y,
74 /// which satisfies the equation x = 2 ^ y.
75 ///
76 /// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier.
77 /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
78 /// @tparam T Floating-point scalar types.
79 ///
80 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
81 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
82 template<length_t L, typename T, qualifier Q>
83 GLM_FUNC_DECL vec<L, T, Q> log2(vec<L, T, Q> const& v);
84
85 /// Returns the positive square root of v.
86 ///
87 /// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier.
88 /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
89 /// @tparam T Floating-point scalar types.
90 ///
91 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
92 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
93 template<length_t L, typename T, qualifier Q>
94 GLM_FUNC_DECL vec<L, T, Q> sqrt(vec<L, T, Q> const& v);
95
96 /// Returns the reciprocal of the positive square root of v.
97 ///
98 /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier.
99 /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
100 /// @tparam T Floating-point scalar types.
101 ///
102 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
103 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
104 template<length_t L, typename T, qualifier Q>
105 GLM_FUNC_DECL vec<L, T, Q> inversesqrt(vec<L, T, Q> const& v);
106
107 /// @}
108}//namespace glm
109
110#include "detail/func_exponential.inl"