physics_plus 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/physics_plus/main/constants.rb +85 -68
- data/lib/physics_plus/version.rb +1 -1
- data/lib/physics_plus.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e649015dbe928f7849b8bd13d0c4a3659e64439a35cccfdc27350c548ff5d8c
|
4
|
+
data.tar.gz: e78e605022870a0d6c93e707659d7ef952d9f914b37465ddaf5974a4952290a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b984bac8ca85f5e209da9488cc73a06388e0dcac8d126a46e76fdc1ef02ba757007e9a44df7330886e799519692adc22e19bcaefe09b6193617c4c747df0f658
|
7
|
+
data.tar.gz: cc027d1988dd1e9f63a175f8d58784369577b33618e74294af15dc000eebdf521546efc2d9e7291efa924216a99ca14467203166187d3ef13baad9694914b11f
|
@@ -6,124 +6,141 @@ module Main
|
|
6
6
|
# @return [String] List fundamental constants
|
7
7
|
def list_fundamental_constants
|
8
8
|
constants = <<~CONSTANTS
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
Const_C => 299792458 (speed of light)
|
10
|
+
Const_G => 6.674484e-11 (gravitational constant)
|
11
|
+
Const_h => 6.62607015e-34 (constant Plank)
|
12
|
+
Const_h_line => 1.0545717999999998e-34 (Dirac constant)
|
13
|
+
Const_e => 1.6021766340000001e-19 (elementary charge)
|
14
|
+
Const_k => 1.380649e-23 (Boltzmann's constant)
|
15
15
|
CONSTANTS
|
16
16
|
end
|
17
17
|
|
18
18
|
# @return [Integer]
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
Const_C = 299792458.freeze
|
20
|
+
# def C
|
21
|
+
# 299792458
|
22
|
+
# end
|
22
23
|
|
23
24
|
# @return [Float]
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
Const_G = (6.674484 * ( 10 ** (11 * -1.0 ) )).freeze
|
26
|
+
# def G
|
27
|
+
# 6.674484 * ( 10 ** (11 * -1.0 ) )
|
28
|
+
# end
|
27
29
|
|
28
30
|
# @return [Float]
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
Const_h = (6.62607015 * ( 10 ** (34 * -1.0 ) )).freeze
|
32
|
+
# def h
|
33
|
+
# 6.62607015 * ( 10 ** (34 * -1.0 ) )
|
34
|
+
# end
|
32
35
|
|
33
36
|
# @return [Float]
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
Const_h_line = (1.0545718 * ( 10 ** (34 * -1.0 ) )).freeze
|
38
|
+
# def h_line
|
39
|
+
# 1.0545718 * ( 10 ** (34 * -1.0 ) )
|
40
|
+
# end
|
37
41
|
|
38
42
|
# @return [Float]
|
39
|
-
|
40
|
-
|
41
|
-
|
43
|
+
Const_e = (1.602176634 * ( 10 ** (19 * -1.0 ) )).freeze
|
44
|
+
# def e
|
45
|
+
# 1.602176634 * ( 10 ** (19 * -1.0 ) )
|
46
|
+
# end
|
42
47
|
|
43
48
|
# @return [Float]
|
44
|
-
|
45
|
-
|
46
|
-
|
49
|
+
Const_k = (1.380649 * ( 10 ** (23 * -1.0 ) )).freeze
|
50
|
+
# def k
|
51
|
+
# 1.380649 * ( 10 ** (23 * -1.0 ) )
|
52
|
+
# end
|
47
53
|
|
48
54
|
|
49
55
|
# @return [String] List of planck quantities
|
50
56
|
def list_planck_quantities
|
51
57
|
constants = <<~CONSTANTS
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
58
|
+
Const_m_p => 2.176434e-08 (Planck mass)
|
59
|
+
Const_l_p => 1.616255e-35 (Planck length)
|
60
|
+
Const_t_p => 5.391246999999999e-44 (Planck time)
|
61
|
+
Const_T_p => 1.4167840000000002e+32 (Planck temperature)
|
56
62
|
CONSTANTS
|
57
63
|
end
|
58
64
|
|
59
65
|
# @return [Float]
|
60
|
-
|
61
|
-
|
62
|
-
|
66
|
+
Const_m_p = (2.176434 * ( 10 ** (8 * -1.0 ) )).freeze
|
67
|
+
# def m_p
|
68
|
+
# 2.176434 * ( 10 ** (8 * -1.0 ) )
|
69
|
+
# end
|
63
70
|
|
64
71
|
# @return [Float]
|
65
|
-
|
66
|
-
|
67
|
-
|
72
|
+
Const_l_p = (1.616255 * ( 10 ** (35 * -1.0 ) )).freeze
|
73
|
+
# def l_p
|
74
|
+
# 1.616255 * ( 10 ** (35 * -1.0 ) )
|
75
|
+
# end
|
68
76
|
|
69
77
|
# @return [Float]
|
70
|
-
|
71
|
-
|
72
|
-
|
78
|
+
Const_t_p = (5.391247 * ( 10 ** (44 * -1.0 ) )).freeze
|
79
|
+
# def t_p
|
80
|
+
# 5.391247 * ( 10 ** (44 * -1.0 ) )
|
81
|
+
# end
|
73
82
|
|
74
83
|
# @return [Integer]
|
75
|
-
|
76
|
-
|
77
|
-
|
84
|
+
Const_T_p = (1.416784 * ( 10 ** (32 * 1.0 ) )).freeze
|
85
|
+
# def T_p
|
86
|
+
# 1.416784 * ( 10 ** (32 * 1.0 ) )
|
87
|
+
# end
|
78
88
|
|
79
89
|
|
80
90
|
# @return [String] List Constants linking different systems of units and conversion factors
|
81
91
|
def list_planck_quantities
|
82
92
|
constants = <<~CONSTANTS
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
93
|
+
Const_alpha => 0.0072973525693 (fine structure constant)
|
94
|
+
Const_epsilon_0 => 8.854187812799999e-12 (electrical constant)
|
95
|
+
Const_a_e_m => 4.1868 (atomic mass unit)
|
96
|
+
Const_Na => 6.02214076e+23 (Avogadro's constant)
|
97
|
+
Const_eV => 1.6021766340000001e-19 (electron volt)
|
98
|
+
Const_Calorie => 4.1868 (calorie)
|
99
|
+
Const_liter_atmosphere => 101325 (liter * atmosphere)
|
90
100
|
CONSTANTS
|
91
101
|
end
|
92
102
|
|
93
103
|
# @return [Float]
|
94
|
-
|
95
|
-
|
96
|
-
|
104
|
+
Const_alpha = (7.2973525693 * ( 10 ** (3 * -1.0 ) )).freeze
|
105
|
+
# def alpha
|
106
|
+
# 7.2973525693 * ( 10 ** (3 * -1.0 ) )
|
107
|
+
# end
|
97
108
|
|
98
109
|
# @return [Float]
|
99
|
-
|
100
|
-
|
101
|
-
|
110
|
+
Const_epsilon_0 = (8.8541878128 * ( 10 ** (12 * -1.0 ) )).freeze
|
111
|
+
# def epsilon_0
|
112
|
+
# 8.8541878128 * ( 10 ** (12 * -1.0 ) )
|
113
|
+
# end
|
102
114
|
|
103
115
|
# @return [Float]
|
104
|
-
|
105
|
-
|
106
|
-
|
116
|
+
Const_a_e_m = (1.66053906660 * ( 10 ** (27 * -1.0 ) )).freeze
|
117
|
+
# def a_e_m
|
118
|
+
# 1.66053906660 * ( 10 ** (27 * -1.0 ) )
|
119
|
+
# end
|
107
120
|
|
108
121
|
# @return [Integer]
|
109
|
-
|
110
|
-
|
111
|
-
|
122
|
+
Const_Na = (6.02214076 * ( 10 ** (23 * 1.0 ) )).freeze
|
123
|
+
# def Na
|
124
|
+
# 6.02214076 * ( 10 ** (23 * 1.0 ) )
|
125
|
+
# end
|
112
126
|
|
113
127
|
# @return [Float]
|
114
|
-
|
115
|
-
|
116
|
-
|
128
|
+
Const_eV = (1.602176634 * ( 10 ** (19 * -1.0 ) )).freeze
|
129
|
+
# def eV
|
130
|
+
# 1.602176634 * ( 10 ** (19 * -1.0 ) )
|
131
|
+
# end
|
117
132
|
|
118
133
|
# @return [Float]
|
119
|
-
|
120
|
-
|
121
|
-
|
134
|
+
Const_Calorie = 4.1868.freeze
|
135
|
+
# def calorie
|
136
|
+
# 4.1868
|
137
|
+
# end
|
122
138
|
|
123
139
|
# @return [Integer]
|
124
|
-
|
125
|
-
|
126
|
-
|
140
|
+
Const_liter_atmosphere = (101325).freeze
|
141
|
+
# def liter_atmosphere
|
142
|
+
# 101325
|
143
|
+
# end
|
127
144
|
|
128
145
|
end
|
129
146
|
end
|
data/lib/physics_plus/version.rb
CHANGED
data/lib/physics_plus.rb
CHANGED