GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
DesignLab
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
namespace
designlab
{
12
21
template
<
typename
T>
22
struct
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
30
template
<>
31
struct
MathConst
<float> {
33
static
constexpr
float
kAllowableError = 0.001f;
34
36
static
constexpr
float
kRoundAngle = 360.0f;
37
};
38
41
template
<>
42
struct
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_
designlab
Definition
abstract_dxlib_gui.cpp:18
designlab::MathConst
float 型と double 型の定数を提供するクラス.
Definition
math_const.h:22
構築:
1.9.8