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
11namespace designlab {
12
21template <typename T>
22struct MathConst {
23 // Tが float でも double でもない場合,エラーを出す.
24 static_assert(std::is_same<T, float>::value || std::is_same<T, double>::value,
25 "T is provided only for float and double types.");
26};
27
30template <>
31struct MathConst<float> {
33 static constexpr float kAllowableError = 0.001f;
34
36 static constexpr float kRoundAngle = 360.0f;
37};
38
41template <>
42struct MathConst<double> {
44 static constexpr double kAllowableError = 0.001;
45
47 static constexpr double kRoundAngle = 360.0;
48};
49
50} // namespace designlab
51
52#endif // DESIGNLAB_MATH_CONST_H_
float 型と double 型の定数を提供するクラス.
Definition math_const.h:22