Added license info into the .py files.
[golden_search.git] / constants.py
blobc628766df1682646700e20478151084322993390
1 # For licensing info see the included LICENSE file
3 # Josef Moudrik, <J dot Moudrik at standard google mail ending>, 2012
5 # -*- coding: utf-8 -*-
7 import math
9 from number import Number
11 def add_constant(n):
12 CONSTANTS.append(n)
14 NAT_CONSTANTS = [
15 Number(1.61803398874989, string='Golden Ratio'),
16 Number(1/1.61803398874989, string='Golden Ratio Inverted'),
17 Number(0.577215664901, string='Euler-Mascheroni'),
18 Number(26000, string='Sun-Milky way center (in light years)'),
19 Number(math.e, string='e'),
20 Number(math.pi, string='Pi'),
21 Number(math.sqrt(2), string=u'√2'),
22 Number(math.log(2), string=u'ln(2)'),
23 Number(147 * 10**9, units={'m':1}, string='Earth-Sun Perihelium distance'),
24 Number(152 * 10**9, units={'m':1}, string='Earth-Sun Aphelium distance'),
25 Number(384400 * 10**3, units={'m':1}, string='Earth-Moon distance'),
26 Number(40075017, units={'m':1}, string='Earth Circumference Eq'),
27 Number(40007860, units={'m':1}, string='Earth Circumference Pol'),
28 Number(6378100, units={'m':1}, string='Earth Radius Eq'),
29 Number(6356800, units={'m':1}, string='Earth Radius Pol'),
30 Number(2.42, string='Earth Land:Sea Ratio'),
31 #Number(299792458, units={'m':1, 's':-1}, string='Speed of Light')
34 CISLA = [
35 Number(3.0/10, string='Cislo 3:10'),
36 Number(6.0/10, string='Cislo 6:10'),
37 Number(9.0/10, string='Cislo 9:10'),
38 Number(10**3, string='Cislo 10^3'),
39 Number(10**6, string='Cislo 10^6'),
40 Number(10**9, string='Cislo 10^9'),
42 CONSTANTS = NAT_CONSTANTS