MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
angle.hpp
Go to the documentation of this file.
1/*
2
3Copyright 2025 Matthew Tolman
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16
17*/
18
19#ifndef MTCORE_UNIT_ANGLE_HPP
20#define MTCORE_UNIT_ANGLE_HPP
21
22#include "mtcore/units/base.hpp"
23
24namespace mtcore::units {
25 namespace angle {
28 } // namespace angle
29
30 static_assert((std::numbers::pi_v<double> * angle::radians).to(angle::degree).val == 180);
31 static_assert((180. * angle::degree).to(angle::radians).val == std::numbers::pi_v<double>);
32
33 MTCORE_DEF_UNIT_NAME(angle, radians, rad)
34 MTCORE_DEF_UNIT_NAME_SYM(angle, degree, deg, "°")
35} // namespace mtcore::units
36
37#endif // MTCORE_UNIT_ANGLE_HPP
constexpr auto degree
Definition angle.hpp:27
constexpr auto radians
Definition angle.hpp:26
Base namespace for units.
Definition angle.hpp:24
List of units.
#define MTCORE_DEF_UNIT_NAME_SYM(NS, UNIT, ABBREV, SYM)
#define MTCORE_DEF_UNIT_NAME(NS, UNIT, ABBREV)