Loading...
Searching...
No Matches
constants.hpp
Go to the documentation of this file.
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 * http://www.apache.org/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
28// TODO, use C++20 numerical constants when we can
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
50} // namespace cuproj
constexpr T DEG_TO_RAD
Conversion factor from degrees to radians.
Definition constants.hpp:40
constexpr T RAD_TO_DEG
Conversion factor from radians to degrees.
Definition constants.hpp:44