mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-29 22:08:45 +08:00
Added maths constants
This commit is contained in:
parent
e31c2756bf
commit
1fa04a79ca
51
include/etl/math_constants.h
Normal file
51
include/etl/math_constants.h
Normal file
@ -0,0 +1,51 @@
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2018 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
coPIes of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
coPIes or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef ETL_MATH_CONSTANTS_INCLUDED
|
||||
#define ETL_MATH_CONSTANTS_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
namespace math
|
||||
{
|
||||
const double pi = 3.14159265358979;
|
||||
const double pi_reciprocal = 0.31830988618379;
|
||||
const double pi_squared = 9.86960440108936;
|
||||
const double e = 2.71828182845905;
|
||||
const double e_reciprocal = 0.36787944117144;
|
||||
const double e_squared = 7.38905609893065;
|
||||
const double root2 = 1.41421356237310;
|
||||
const double root2_reciprocal = 0.70710678118655;
|
||||
const double euler = 0.57721566490153;
|
||||
const double golden_ratio = 1.61803398874989;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user