MathConstants
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RicardoSantos

//@version=5

// @description Mathematical Constants
library(title='MathConstants')

//  reference:
//      https://github.com/mathnet/mathnet-numerics/blob/master/src/Numerics/Constants.cs


// A collection of frequently used mathematical constants.
    
// Mathematical Constants {

// @function The number e
export E () => //{
    2.7182818284590452353602874713526624977572470937000
//}

// @function The number log[2](e)
export Log2E () => //{
    1.4426950408889634073599246810018921374266459541530
//}

// @function The number log[10](e)
export Log10E () => //{
    0.43429448190325182765112891891660508229439700580366
//}

// @function The number log[e](2)
export Ln2 () => //{
    0.69314718055994530941723212145817656807550013436026
//}

// @function The number log[e](10)
export Ln10 () => //{
    2.3025850929940456840179914546843642076011014886288
//}

// @function The number log[e](pi)
export LnPi () => //{
    1.1447298858494001741434273513530587116472948129153
//}

// @function The number log[e](2*pi)/2
export Ln2PiOver2 () => //{
    0.91893853320467274178032973640561763986139747363780
//}

// @function The number 1/e
export InvE () => //{
    0.36787944117144232159552377016146086744581113103176
//}

// @function The number sqrt(e)
export SqrtE () => //{
    1.6487212707001281468486507878141635716537761007101
//}

// @function The number sqrt(2)
export Sqrt2 () => //{
    1.4142135623730950488016887242096980785696718753769
//}

// @function The number sqrt(3)
export Sqrt3 () => //{
    1.7320508075688772935274463415058723669428052538104
//}

// @function The number sqrt(1/2) = 1/sqrt(2) = sqrt(2)/2
export Sqrt1Over2 () => //{
    0.70710678118654752440084436210484903928483593768845
//}

// @function The number sqrt(3)/2
export HalfSqrt3 () => //{
    0.86602540378443864676372317075293618347140262690520
//}

// @function The number pi
export Pi () => //{
    3.1415926535897932384626433832795028841971693993751
//}

// @function The number pi*2
export Pi2 () => //{
    6.2831853071795864769252867665590057683943387987502
//}

// @function The number pi/2
export PiOver2 () => //{
    1.5707963267948966192313216916397514420985846996876
//}

// @function The number pi*3/2
export Pi3Over2 () => //{
    4.71238898038468985769396507491925432629575409906266
//}

// @function The number pi/4
export PiOver4 () => //{
    0.78539816339744830961566084581987572104929234984378
//}

// @function The number sqrt(pi)
export SqrtPi () => //{
    1.7724538509055160272981674833411451827975494561224
//}

// @function The number sqrt(2pi)
export Sqrt2Pi () => //{
    2.5066282746310005024157652848110452530069867406099
//}

// @function The number sqrt(pi/2)
export SqrtPiOver2 () => //{
    1.2533141373155002512078826424055226265034933703050
//}

// @function The number sqrt(2*pi*e)
export Sqrt2PiE () => //{
    4.1327313541224929384693918842998526494455219169913
//}

// @function The number log(sqrt(2*pi))
export LogSqrt2Pi () => //{
    0.91893853320467274178032973640561763986139747363778
//}

// @function The number log(sqrt(2*pi*e))
export LogSqrt2PiE () => //{
    1.4189385332046727417803297364056176398613974736378
//}

// @function The number log(2 * sqrt(e / pi))
export LogTwoSqrtEOverPi () => //{
    0.6207822376352452223455184457816472122518527279025978
//}

// @function The number 1/pi
export InvPi () => //{
    0.31830988618379067153776752674502872406891929148091
//}

// @function The number 2/pi
export TwoInvPi () => //{
    0.63661977236758134307553505349005744813783858296182
//}

// @function The number 1/sqrt(pi)
export InvSqrtPi () => //{
    0.56418958354775628694807945156077258584405062932899
//}

// @function The number 1/sqrt(2pi)
export InvSqrt2Pi () => //{
    0.39894228040143267793994605993438186847585863116492
//}

// @function The number 2/sqrt(pi)
export TwoInvSqrtPi () => //{
    1.1283791670955125738961589031215451716881012586580
//}

// @function The number 2 * sqrt(e / pi)
export TwoSqrtEOverPi () => //{
    1.8603827342052657173362492472666631120594218414085755
//}

// @function The number (pi)/180 - factor to convert from Degree (deg) to Radians (rad).
export Degree () => //{
    0.017453292519943295769236907684886127134428718885417
//}

// @function The number (pi)/200 - factor to convert from NewGrad (grad) to Radians (rad).
export Grad () => //{
    0.015707963267948966192313216916397514420985846996876
//}

// @function The number ln(10)/20 - factor to convert from Power Decibel (dB) to Neper (Np). Use this version when the Decibel represent a power gain but the compared values are not powers (e.g. amplitude, current, voltage).
export PowerDecibel () => //{
    0.11512925464970228420089957273421821038005507443144
//}

// @function The number ln(10)/10 - factor to convert from Neutral Decibel (dB) to Neper (Np). Use this version when either both or neither of the Decibel and the compared values represent powers.
export NeutralDecibel () => //{
    0.23025850929940456840179914546843642076011014886288
//}

// @function The Catalan constant
// Sum(k=0 -> inf){ (-1)^k/(2*k + 1)2 }
export Catalan () => //{
    0.9159655941772190150546035149323841107741493742816721342664981196217630197762547694794
//}

// @function The Euler-Mascheroni constant
// lim(n -> inf){ Sum(k=1 -> n) { 1/k - log(n) } }
export EulerMascheroni () => //{
    0.5772156649015328606065120900824024310421593359399235988057672348849
//}

// @function The number (1+sqrt(5))/2, also known as the golden ratio
export GoldenRatio () => //{
    1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072
//}

// @function The Glaisher constant
// e^(1/12 - Zeta(-1))
export Glaisher () => //{
    1.2824271291006226368753425688697917277676889273250011920637400217404063088588264611297
//}

// @function The Khinchin constant
// prod(k=1 -> inf){1+1/(k*(k+2))^log(k,2)}
export Khinchin () => //{
    2.6854520010653064453097148354817956938203822939944629530511523455572188595371520028011
//}

//}
