GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
math_const.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_MATH_CONST_H_
9#define DESIGNLAB_MATH_CONST_H_
10
11
12namespace designlab
13{
14
23template<typename T>
25{
26 // Tが float でも double でもない場合,エラーを出す.
27 static_assert(std::is_same<T, float>::value || std::is_same<T, double>::value,
28 "T is provided only for float and double types.");
29};
30
31
34template<>
35struct MathConst<float>
36{
38 static constexpr float kAllowableError = 0.001f;
39
41 static constexpr float kRoundAngle = 360.0f;
42};
43
46template<>
47struct MathConst<double>
48{
50 static constexpr double kAllowableError = 0.001;
51
53 static constexpr double kRoundAngle = 360.0;
54};
55
56
57} // namespace designlab
58
59#endif // DESIGNLAB_MATH_CONST_H_
float 型と double 型の定数を提供するクラス.
Definition math_const.h:25