sciplot  0.3.1
A modern C++ plotting library powered by gnuplot
Constants.hpp
1 // sciplot - a modern C++ scientific plotting library powered by gnuplot
2 // https://github.com/sciplot/sciplot
3 //
4 // Licensed under the MIT License <http://opensource.org/licenses/MIT>.
5 //
6 // Copyright (c) 2018-2021 Allan Leal
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in all
16 // copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // SOFTWARE.
25 
26 #pragma once
27 
28 // C++ includes
29 #include <limits>
30 #include <string>
31 
32 namespace sciplot {
33 
34 const auto PI = 3.14159265359;
35 const auto GOLDEN_RATIO = 1.618034;
36 const auto GOLDEN_RATIO_INVERSE = 1.0 / GOLDEN_RATIO;
37 const auto INCH_TO_POINTS = 72.0; // based on pdfcairo terminal conversion
38 const auto POINT_TO_INCHES = 1.0 / INCH_TO_POINTS;
39 
40 constexpr auto NaN = std::numeric_limits<double>::quiet_NaN(); // can be used to indicate missing values in a numeric vector
41 const auto MISSING_INDICATOR = "\"?\""; // The string used to indicate missing y values.
42 
43 } // namespace sciplot