Initial commit. Please see the README
[golden_search.git] / constants.py
blobd5f642e71c0750e10b3dc9087b4434b4cf33c410
1 # -*- coding: utf-8 -*-
3 import math
5 from number import Number
7 def add_constant(n):
8 CONSTANTS.append(n)
10 NAT_CONSTANTS = [
11 Number(1.61803398874989, string='Golden Ratio'),
12 Number(1/1.61803398874989, string='Golden Ratio Inverted'),
13 Number(0.577215664901, string='Euler-Mascheroni'),
14 Number(26000, string='Sun-Milky way center (in light years)'),
15 Number(math.e, string='e'),
16 Number(math.pi, string='Pi'),
17 Number(math.sqrt(2), string=u'√2'),
18 Number(math.log(2), string=u'ln(2)'),
19 Number(147 * 10**9, units={'m':1}, string='Earth-Sun Perihelium distance'),
20 Number(152 * 10**9, units={'m':1}, string='Earth-Sun Aphelium distance'),
21 Number(384400 * 10**3, units={'m':1}, string='Earth-Moon distance'),
22 Number(40075017, units={'m':1}, string='Earth Circumference Eq'),
23 Number(40007860, units={'m':1}, string='Earth Circumference Pol'),
24 Number(6378100, units={'m':1}, string='Earth Radius Eq'),
25 Number(6356800, units={'m':1}, string='Earth Radius Pol'),
26 Number(2.42, string='Earth Land:Sea Ratio'),
27 #Number(299792458, units={'m':1, 's':-1}, string='Speed of Light')
30 CISLA = [
31 Number(3.0/10, string='Cislo 3:10'),
32 Number(6.0/10, string='Cislo 6:10'),
33 Number(9.0/10, string='Cislo 9:10'),
34 Number(10**3, string='Cislo 10^3'),
35 Number(10**6, string='Cislo 10^6'),
36 Number(10**9, string='Cislo 10^9'),
38 CONSTANTS = NAT_CONSTANTS