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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed3bc4940a1f6174f52c7881e6f20d07f658e61d029fc8278a15cc7347eefecd
4
- data.tar.gz: dae35ea4e274d89548bb47c9fe09569dce115f99cba128b01d0a383ca0e4b662
3
+ metadata.gz: 1e649015dbe928f7849b8bd13d0c4a3659e64439a35cccfdc27350c548ff5d8c
4
+ data.tar.gz: e78e605022870a0d6c93e707659d7ef952d9f914b37465ddaf5974a4952290a6
5
5
  SHA512:
6
- metadata.gz: 81fb4da0a449e614e968f7232d1a62d6179909a6e24bdba16639d3f2e6d11655327abf9a0b009dba00ad76926bee61a01d948a8429b2b77b72e596d9bb639ce0
7
- data.tar.gz: be4ed0df358284327773da85fe76eb2191cbfe9196683bc88bdfe4e245c7fd13e86c011a059d3ed42bfd7b8ad471881dc80c8c5edeb3a9a097ae96d8c94ace82
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
- C => 299792458 (speed of light)
10
- G => 6.674484e-11 (gravitational constant)
11
- h => 6.62607015e-34 (constant Plank)
12
- h_line => 1.0545717999999998e-34 (Dirac constant)
13
- e => 1.6021766340000001e-19 (elementary charge)
14
- k => 1.380649e-23 (Boltzmann's constant)
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
- def C
20
- 299792458
21
- end
19
+ Const_C = 299792458.freeze
20
+ # def C
21
+ # 299792458
22
+ # end
22
23
 
23
24
  # @return [Float]
24
- def G
25
- 6.674484 * ( 10 ** (11 * -1.0 ) )
26
- end
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
- def h
30
- 6.62607015 * ( 10 ** (34 * -1.0 ) )
31
- end
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
- def h_line
35
- 1.0545718 * ( 10 ** (34 * -1.0 ) )
36
- end
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
- def e
40
- 1.602176634 * ( 10 ** (19 * -1.0 ) )
41
- end
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
- def k
45
- 1.380649 * ( 10 ** (23 * -1.0 ) )
46
- end
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
- m_p => 2.176434e-08 (Planck mass)
53
- l_p => 1.616255e-35 (Planck length)
54
- t_p => 5.391246999999999e-44 (Planck time)
55
- T_p => 1.4167840000000002e+32 (Planck temperature)
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
- def m_p
61
- 2.176434 * ( 10 ** (8 * -1.0 ) )
62
- end
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
- def l_p
66
- 1.616255 * ( 10 ** (35 * -1.0 ) )
67
- end
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
- def t_p
71
- 5.391247 * ( 10 ** (44 * -1.0 ) )
72
- end
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
- def T_p
76
- 1.416784 * ( 10 ** (32 * 1.0 ) )
77
- end
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
- alpha => 0.0072973525693 (fine structure constant)
84
- epsilon_0 => 8.854187812799999e-12 (electrical constant)
85
- a_e_m => 4.1868 (atomic mass unit)
86
- Na => 6.02214076e+23 (Avogadro's constant)
87
- eV => 1.6021766340000001e-19 (electron volt)
88
- calorie => 4.1868 (calorie)
89
- liter_atmosphere => 101325 (liter * atmosphere)
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
- def alpha
95
- 7.2973525693 * ( 10 ** (3 * -1.0 ) )
96
- end
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
- def epsilon_0
100
- 8.8541878128 * ( 10 ** (12 * -1.0 ) )
101
- end
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
- def a_e_m
105
- 1.66053906660 * ( 10 ** (27 * -1.0 ) )
106
- end
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
- def Na
110
- 6.02214076 * ( 10 ** (23 * 1.0 ) )
111
- end
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
- def eV
115
- 1.602176634 * ( 10 ** (19 * -1.0 ) )
116
- end
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
- def calorie
120
- 4.1868
121
- end
134
+ Const_Calorie = 4.1868.freeze
135
+ # def calorie
136
+ # 4.1868
137
+ # end
122
138
 
123
139
  # @return [Integer]
124
- def liter_atmosphere
125
- 101325
126
- end
140
+ Const_liter_atmosphere = (101325).freeze
141
+ # def liter_atmosphere
142
+ # 101325
143
+ # end
127
144
 
128
145
  end
129
146
  end
@@ -1,5 +1,5 @@
1
1
  # This module VERSION gem
2
2
  module PhysicsPlus
3
3
  # @return VERSION
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
data/lib/physics_plus.rb CHANGED
@@ -5,4 +5,8 @@ require_relative 'physics_plus/main/constants'
5
5
  module PhysicsPlus
6
6
  # Main module
7
7
  extend Main::Constants
8
+ include Main::Constants
8
9
  end
10
+
11
+
12
+ puts PhysicsPlus.list_fundamental_constants
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: physics_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlexVikPast