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
12
namespace
designlab
13
{
14
23
template
<
typename
T>
24
struct
MathConst
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
34
template
<>
35
struct
MathConst
<float>
36
{
38
static
constexpr
float
kAllowableError = 0.001f;
39
41
static
constexpr
float
kRoundAngle = 360.0f;
42
};
43
46
template
<>
47
struct
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_
designlab
Definition
abstract_dxlib_gui.cpp:18
designlab::MathConst
float 型と double 型の定数を提供するクラス.
Definition
math_const.h:25
構築:
1.9.8