8# define M_PI 3.14159265358979323846
14#include "structure/math/spk_vector2.hpp"
15#include "structure/math/spk_vector3.hpp"
16#include "structure/math/spk_vector4.hpp"
22 float degreeToRadian(
float p_degrees);
23 float radianToDegree(
float p_radians);
25 intmax_t positiveModulo(
const intmax_t &p_value,
const intmax_t &p_modulo);
37 template <
typename TScalar>
56 std::numeric_limits<TScalar>::min(),
57 std::numeric_limits<TScalar>::min()};
67 std::numeric_limits<TScalar>::max(),
68 std::numeric_limits<TScalar>::max()};
78 std::numeric_limits<TScalar>::lowest(),
79 std::numeric_limits<TScalar>::lowest()};
83 static constexpr int digits = std::numeric_limits<TScalar>::digits;
85 static constexpr int digits10 = std::numeric_limits<TScalar>::digits10;
87 static constexpr int max_digits10 = std::numeric_limits<TScalar>::max_digits10;
90 static constexpr bool is_signed = std::numeric_limits<TScalar>::is_signed;
92 static constexpr bool is_integer = std::numeric_limits<TScalar>::is_integer;
94 static constexpr bool is_exact = std::numeric_limits<TScalar>::is_exact;
97 static constexpr int radix = std::numeric_limits<TScalar>::radix;
106 std::numeric_limits<TScalar>::epsilon(),
107 std::numeric_limits<TScalar>::epsilon()};
117 std::numeric_limits<TScalar>::round_error(),
118 std::numeric_limits<TScalar>::round_error()};
132 template <
typename TScalar>
151 std::numeric_limits<TScalar>::min(),
152 std::numeric_limits<TScalar>::min(),
153 std::numeric_limits<TScalar>::min()};
163 std::numeric_limits<TScalar>::max(),
164 std::numeric_limits<TScalar>::max(),
165 std::numeric_limits<TScalar>::max()};
175 std::numeric_limits<TScalar>::lowest(),
176 std::numeric_limits<TScalar>::lowest(),
177 std::numeric_limits<TScalar>::lowest()};
181 static constexpr int digits = std::numeric_limits<TScalar>::digits;
183 static constexpr int digits10 = std::numeric_limits<TScalar>::digits10;
185 static constexpr int max_digits10 = std::numeric_limits<TScalar>::max_digits10;
188 static constexpr bool is_signed = std::numeric_limits<TScalar>::is_signed;
190 static constexpr bool is_integer = std::numeric_limits<TScalar>::is_integer;
192 static constexpr bool is_exact = std::numeric_limits<TScalar>::is_exact;
195 static constexpr int radix = std::numeric_limits<TScalar>::radix;
204 std::numeric_limits<TScalar>::epsilon(),
205 std::numeric_limits<TScalar>::epsilon(),
206 std::numeric_limits<TScalar>::epsilon()};
216 std::numeric_limits<TScalar>::round_error(),
217 std::numeric_limits<TScalar>::round_error(),
218 std::numeric_limits<TScalar>::round_error()};
232 template <
typename TScalar>
251 std::numeric_limits<TScalar>::min(),
252 std::numeric_limits<TScalar>::min(),
253 std::numeric_limits<TScalar>::min(),
254 std::numeric_limits<TScalar>::min()};
264 std::numeric_limits<TScalar>::max(),
265 std::numeric_limits<TScalar>::max(),
266 std::numeric_limits<TScalar>::max(),
267 std::numeric_limits<TScalar>::max()};
277 std::numeric_limits<TScalar>::lowest(),
278 std::numeric_limits<TScalar>::lowest(),
279 std::numeric_limits<TScalar>::lowest(),
280 std::numeric_limits<TScalar>::lowest()};
284 static constexpr int digits = std::numeric_limits<TScalar>::digits;
286 static constexpr int digits10 = std::numeric_limits<TScalar>::digits10;
288 static constexpr int max_digits10 = std::numeric_limits<TScalar>::max_digits10;
291 static constexpr bool is_signed = std::numeric_limits<TScalar>::is_signed;
293 static constexpr bool is_integer = std::numeric_limits<TScalar>::is_integer;
295 static constexpr bool is_exact = std::numeric_limits<TScalar>::is_exact;
298 static constexpr int radix = std::numeric_limits<TScalar>::radix;
307 std::numeric_limits<TScalar>::epsilon(),
308 std::numeric_limits<TScalar>::epsilon(),
309 std::numeric_limits<TScalar>::epsilon(),
310 std::numeric_limits<TScalar>::epsilon()};
320 std::numeric_limits<TScalar>::round_error(),
321 std::numeric_limits<TScalar>::round_error(),
322 std::numeric_limits<TScalar>::round_error(),
323 std::numeric_limits<TScalar>::round_error()};
2D value type holding two components with basic arithmetic helpers.
Definition spk_vector2.hpp:35
3D value type with common arithmetic helpers.
Definition spk_vector3.hpp:34
4D value type with arithmetic helpers and swizzles.
Definition spk_vector4.hpp:34
Numeric limits adapter for 2D vector scalar types.
Definition spk_math_utils.hpp:39
static constexpr value_type lowest() noexcept
Returns the lowest finite value for each component.
Definition spk_math_utils.hpp:75
static constexpr bool is_specialized
Indicates this specialization is provided.
Definition spk_math_utils.hpp:47
static constexpr value_type roundError() noexcept
Returns the rounding error for each component.
Definition spk_math_utils.hpp:114
static constexpr value_type min() noexcept
Returns the minimum finite value for each component.
Definition spk_math_utils.hpp:53
static constexpr int max_digits10
Maximum number of base-10 digits to preserve round-trips.
Definition spk_math_utils.hpp:87
static constexpr value_type epsilon() noexcept
Returns the machine epsilon for each component.
Definition spk_math_utils.hpp:103
IVector2< TScalar > value_type
Vector type using the provided scalar.
Definition spk_math_utils.hpp:44
static constexpr int digits
Number of radix digits for the scalar type.
Definition spk_math_utils.hpp:83
static constexpr bool is_exact
true if the scalar type is exact.
Definition spk_math_utils.hpp:94
static constexpr int radix
The radix of the scalar type representation.
Definition spk_math_utils.hpp:97
static constexpr bool is_signed
true if the scalar type is signed.
Definition spk_math_utils.hpp:90
static constexpr bool is_integer
true if the scalar type is integer.
Definition spk_math_utils.hpp:92
static constexpr value_type max() noexcept
Returns the maximum finite value for each component.
Definition spk_math_utils.hpp:64
static constexpr int digits10
Number of base-10 digits for the scalar type.
Definition spk_math_utils.hpp:85
Numeric limits adapter for 3D vector scalar types.
Definition spk_math_utils.hpp:134
static constexpr value_type min() noexcept
Returns the minimum finite value for each component.
Definition spk_math_utils.hpp:148
static constexpr int max_digits10
Maximum number of base-10 digits to preserve round-trips.
Definition spk_math_utils.hpp:185
static constexpr value_type lowest() noexcept
Returns the lowest finite value for each component.
Definition spk_math_utils.hpp:172
IVector3< TScalar > value_type
Vector type using the provided scalar.
Definition spk_math_utils.hpp:139
static constexpr int digits10
Number of base-10 digits for the scalar type.
Definition spk_math_utils.hpp:183
static constexpr int digits
Number of radix digits for the scalar type.
Definition spk_math_utils.hpp:181
static constexpr value_type epsilon() noexcept
Returns the machine epsilon for each component.
Definition spk_math_utils.hpp:201
static constexpr value_type max() noexcept
Returns the maximum finite value for each component.
Definition spk_math_utils.hpp:160
static constexpr bool is_integer
true if the scalar type is integer.
Definition spk_math_utils.hpp:190
static constexpr bool is_signed
true if the scalar type is signed.
Definition spk_math_utils.hpp:188
static constexpr bool is_exact
true if the scalar type is exact.
Definition spk_math_utils.hpp:192
static constexpr int radix
The radix of the scalar type representation.
Definition spk_math_utils.hpp:195
static constexpr bool is_specialized
Indicates this specialization is provided.
Definition spk_math_utils.hpp:142
static constexpr value_type roundError() noexcept
Returns the rounding error for each component.
Definition spk_math_utils.hpp:213
Numeric limits adapter for 4D vector scalar types.
Definition spk_math_utils.hpp:234
static constexpr value_type roundError() noexcept
Returns the rounding error for each component.
Definition spk_math_utils.hpp:317
IVector4< TScalar > value_type
Vector type using the provided scalar.
Definition spk_math_utils.hpp:239
static constexpr bool is_specialized
Indicates this specialization is provided.
Definition spk_math_utils.hpp:242
static constexpr value_type min() noexcept
Returns the minimum finite value for each component.
Definition spk_math_utils.hpp:248
static constexpr bool is_signed
true if the scalar type is signed.
Definition spk_math_utils.hpp:291
static constexpr value_type lowest() noexcept
Returns the lowest finite value for each component.
Definition spk_math_utils.hpp:274
static constexpr value_type max() noexcept
Returns the maximum finite value for each component.
Definition spk_math_utils.hpp:261
static constexpr int max_digits10
Maximum number of base-10 digits to preserve round-trips.
Definition spk_math_utils.hpp:288
static constexpr int digits
Number of radix digits for the scalar type.
Definition spk_math_utils.hpp:284
static constexpr bool is_exact
true if the scalar type is exact.
Definition spk_math_utils.hpp:295
static constexpr int digits10
Number of base-10 digits for the scalar type.
Definition spk_math_utils.hpp:286
static constexpr bool is_integer
true if the scalar type is integer.
Definition spk_math_utils.hpp:293
static constexpr int radix
The radix of the scalar type representation.
Definition spk_math_utils.hpp:298
static constexpr value_type epsilon() noexcept
Returns the machine epsilon for each component.
Definition spk_math_utils.hpp:304