Steppable 0.0.1
A CAS project written from scratch in C++
Loading...
Searching...
No Matches
constants.hpp
1/**************************************************************************************************
2 * Copyright (c) 2023-2025 NWSOFT *
3 * *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy *
5 * of this software and associated documentation files (the "Software"), to deal *
6 * in the Software without restriction, including without limitation the rights *
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
8 * copies of the Software, and to permit persons to whom the Software is *
9 * furnished to do so, subject to the following conditions: *
10 * *
11 * The above copyright notice and this permission notice shall be included in all *
12 * copies or substantial portions of the Software. *
13 * *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *
20 * SOFTWARE. *
21 **************************************************************************************************/
22
23#pragma once
24
25#include <string_view>
26
32{
34 constexpr const std::string_view PI =
35 "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
36
38 // Generated using Python:
39 // -------------------------------------------------------
40 // 1 | from decimal import Decimal, getcontext
41 // 2 | # Set precision to 100 decimal places.
42 // 3 | getcontext().prec = 100
43 // 4 | Decimal(
44 // 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
45 // 6 | ) * Decimal(2)
46 // -------------------------------------------------------
47 constexpr const std::string_view TWO_PI = "6.283185307179586231995926937088370323181152343750";
48
50 // Generated using Python:
51 // -------------------------------------------------------
52 // 1 | from decimal import Decimal, getcontext
53 // 2 | # Set precision to 100 decimal places.
54 // 3 | getcontext().prec = 100
55 // 4 | Decimal(
56 // 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
57 // 6 | ) / Decimal(2)
58 // -------------------------------------------------------
59 constexpr const std::string_view PI_OVER_2 =
60 "1.570796326794896619231321691639751442098584699687552910487472296153908203143104499314017412835292542";
61
63 // Generated using Python:
64 // -------------------------------------------------------
65 // 1 | from decimal import Decimal, getcontext
66 // 2 | # Set precision to 100 decimal places.
67 // 3 | getcontext().prec = 100
68 // 4 | Decimal(
69 // 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
70 // 6 | ) / Decimal(180)
71 // -------------------------------------------------------
72 constexpr const std::string_view PI_OVER_180 =
73 "0.01745329251994329508887757482524547311994764539930555555555555555555555555555555555555555555555555556";
74
76 // Generated using Python:
77 // -------------------------------------------------------
78 // 1 | from decimal import Decimal, getcontext
79 // 2 | # Set precision to 100 decimal places.
80 // 3 | getcontext().prec = 100
81 // 4 | Decimal(
82 // 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
83 // 6 | ) / Decimal(200)
84 // -------------------------------------------------------
85 constexpr const std::string_view PI_OVER_200 =
86 "0.01570796326794896619231321691639716312084074699687552942986246296153903203140449499314017412671058534";
87
88 constexpr const std::string_view E = "2.718281828459045090795598298427648842334747314453125";
89} // namespace steppable::constants
Numerical constants used in Steppable.
Definition constants.cpp:29
constexpr const std::string_view PI_OVER_180
Pi divided by 180 (to convert degrees to radians), correct to 100 decimal places.
Definition constants.hpp:72
constexpr const std::string_view PI_OVER_2
Pi divided by 2.
Definition constants.hpp:59
constexpr const std::string_view TWO_PI
Pi multiplied by 2.
Definition constants.hpp:47
constexpr const std::string_view PI
100 digits of pi.
Definition constants.hpp:34
constexpr const std::string_view E
Definition constants.hpp:88
constexpr const std::string_view PI_OVER_200
Pi divided by 200 (to convert grads to radians), correct to 100 decimal places.
Definition constants.hpp:85
Untitled