正在加载...
正在搜索...
无匹配项
constants.hpp
前往此文件的文档。
1/*
2 * Copyright (c) 2023, NVIDIA CORPORATION.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://apache.ac.cn/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <cmath>
20
21namespace cuproj {
22
27
28// TODO:当我们能够使用 C++20 数值常量时再使用
29
31template <typename T>
32static constexpr T M_TWOPI = T{2.0} * M_PI; // 6.283185307179586476925286766559005l;
33
35template <typename T>
36static constexpr T EPSILON_RADIANS = T{1e-12};
37
39template <typename T>
40constexpr T DEG_TO_RAD = T{0.017453292519943295769236907684886};
41
43template <typename T>
44constexpr T RAD_TO_DEG = T{57.295779513082320876798154814105};
45
49
50} // namespace cuproj
constexpr T DEG_TO_RAD
从度到弧度的转换因子。
constexpr T RAD_TO_DEG
从弧度到度的转换因子。