physics_plus 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68f215f8775f979e0034ceb43d376dd9b3c2de884e8b2b91e585aa5f6f844002
4
- data.tar.gz: ee1abe52951e3eab86e6fb07c3ebe57f3ae297629d4d883d16a14a73d1085ed9
3
+ metadata.gz: 6329fe0a88532e91bafbf7e96649dc08177209c28bb76734fcda6450c6828995
4
+ data.tar.gz: 4fe3a269c76cf789e45289b27582c6ce04790eebc1327ed55f0438087280fc5b
5
5
  SHA512:
6
- metadata.gz: 151d6de5367201c1e305080b51ce93d447aecfd2b5269545a53df228f009bc5c46986da9aa437dea55ea52c1fe3ef9b5aa803715d5d868db53ada666511cdd56
7
- data.tar.gz: 03fad634f23e53c5ef67cf21d7bc330849c27d90f2b64d174e227d882af9be1d0462da3a36e824a804794b42b49296c9f58631b5595e61514c8cae85e2bf5403
6
+ metadata.gz: dc7f39606c5cedbb88b6f895aa45dc37dd18cfbaceba6f1bd68777adada393d3bc584f7fd0548370307631379561b190a1de6c9ebac7ba2e9c2216a299fd73cf
7
+ data.tar.gz: 6a6d4d89e427bd49d378bb2c88708875f56e5ee8b43c017c5f312fda731076df1dbd49009f10dcbd11cca7175eaf014019d112a58795500e18e8d383f355f909
data/README.md CHANGED
@@ -52,6 +52,8 @@ PhysicsPlus::Optics.power_lens(2) => 0.5
52
52
 
53
53
  PhysicsPlus::ElementsTheoryRelativity.inertial_system_length(1.5, 200_000_000) => 1.1174144036800955
54
54
  PhysicsPlus::ElementsTheoryRelativity.inertial_system_time(60, 200_000_000) => 80.54308205048527
55
+
56
+ PhysicsPlus::Quantums.equivalence_of_mass_and_energy(0.0000000001) => 8987551.787368177
55
57
  ```
56
58
 
57
59
 
@@ -16,22 +16,22 @@ module PhysicsPlus
16
16
  end
17
17
 
18
18
  # @return [Integer]
19
- Speed_light_vacuum = C = 299792458.freeze
19
+ Speed_light_vacuum = C = 299792458
20
20
 
21
21
  # @return [Float]
22
- Gravitational_constant = G = (6.674484 * ( 10 ** (11 * -1.0 ) )).freeze
22
+ Gravitational_constant = G = (6.674484 * ( 10 ** (11 * -1.0 ) ))
23
23
 
24
24
  # @return [Float]
25
- Planck_constant = (6.62607015 * ( 10 ** (34 * -1.0 ) )).freeze
25
+ Planck_constant = (6.62607015 * ( 10 ** (34 * -1.0 ) ))
26
26
 
27
27
  # @return [Float]
28
- Reduced_Planck_constant = (1.0545718 * ( 10 ** (34 * -1.0 ) )).freeze
28
+ Reduced_Planck_constant = (1.0545718 * ( 10 ** (34 * -1.0 ) ))
29
29
 
30
30
  # @return [Float]
31
- Elementary_charge = (1.602176634 * ( 10 ** (19 * -1.0 ) )).freeze
31
+ Elementary_charge = (1.602176634 * ( 10 ** (19 * -1.0 ) ))
32
32
 
33
33
  # @return [Float]
34
- Boltzmanns_constant = (1.380649 * ( 10 ** (23 * -1.0 ) )).freeze
34
+ Boltzmanns_constant = (1.380649 * ( 10 ** (23 * -1.0 ) ))
35
35
 
36
36
 
37
37
  # @return [String] List of planck quantities
@@ -45,16 +45,16 @@ module PhysicsPlus
45
45
  end
46
46
 
47
47
  # @return [Float]
48
- Planck_mass = (2.176434 * ( 10 ** (8 * -1.0 ) )).freeze
48
+ Planck_mass = (2.176434 * ( 10 ** (8 * -1.0 ) ))
49
49
 
50
50
  # @return [Float]
51
- Planck_length = (1.616255 * ( 10 ** (35 * -1.0 ) )).freeze
51
+ Planck_length = (1.616255 * ( 10 ** (35 * -1.0 ) ))
52
52
 
53
53
  # @return [Float]
54
- Planck_time = (5.391247 * ( 10 ** (44 * -1.0 ) )).freeze
54
+ Planck_time = (5.391247 * ( 10 ** (44 * -1.0 ) ))
55
55
 
56
56
  # @return [Float]
57
- Planck_temperature = (1.416784 * ( 10 ** (32 * 1.0 ) )).freeze
57
+ Planck_temperature = (1.416784 * ( 10 ** (32 * 1.0 ) ))
58
58
 
59
59
  # @return [String] List Constants linking different systems of units and conversion factors
60
60
  def self.List_different_systems_quantities
@@ -70,25 +70,25 @@ module PhysicsPlus
70
70
  end
71
71
 
72
72
  # @return [Float]
73
- Fine_structure_constant = (7.2973525693 * ( 10 ** (3 * -1.0 ) )).freeze
73
+ Fine_structure_constant = (7.2973525693 * ( 10 ** (3 * -1.0 ) ))
74
74
 
75
75
  # @return [Float]
76
- Electrical_constant = (8.8541878128 * ( 10 ** (12 * -1.0 ) )).freeze
76
+ Electrical_constant = (8.8541878128 * ( 10 ** (12 * -1.0 ) ))
77
77
 
78
78
  # @return [Float]
79
- Atomic_mass_unit = (1.66053906660 * ( 10 ** (27 * -1.0 ) )).freeze
79
+ Atomic_mass_unit = (1.66053906660 * ( 10 ** (27 * -1.0 ) ))
80
80
 
81
81
  # @return [Float]
82
- Avogadros_constant = (6.02214076 * ( 10 ** (23 * 1.0 ) )).freeze
82
+ Avogadros_constant = (6.02214076 * ( 10 ** (23 * 1.0 ) ))
83
83
 
84
84
  # @return [Float]
85
- Electron_volt = (1.602176634 * ( 10 ** (19 * -1.0 ) )).freeze
85
+ Electron_volt = (1.602176634 * ( 10 ** (19 * -1.0 ) ))
86
86
 
87
87
  # @return [Float]
88
- Calorie = 4.1868.freeze
88
+ Calorie = 4.1868
89
89
 
90
90
  # @return [Integer]
91
- Liter_atmosphere = (101325).freeze
91
+ Liter_atmosphere = (101325)
92
92
 
93
93
  # @return [String] List electromagnetic constants
94
94
  def self.List_electromagnetic_constants
@@ -101,13 +101,30 @@ module PhysicsPlus
101
101
  end
102
102
 
103
103
  # @return [Float]
104
- Magnetic_constant = (1.25663706212 * ( 10 ** (6 * -1.0 ) )).freeze
104
+ Magnetic_constant = (1.25663706212 * ( 10 ** (6 * -1.0 ) ))
105
105
 
106
106
  # @return [Float]
107
107
  Vacuum_impedance = 376.73
108
108
 
109
109
  # @return [Float]
110
- Coulombs_constant = (8.98755 * ( 10 ** (9 * 1.0 ) )).freeze
110
+ Coulombs_constant = (8.98755 * ( 10 ** (9 * 1.0 ) ))
111
111
 
112
+ # @return [String] Some other physical constants
113
+ def Some_other_physical_constants
114
+ constants = <<~CONSTANTS
115
+ Electron_mass => 9.1093837015e-31 (Electron mass)
116
+ Proton_mass => 1.67262192369e-27 (Proton mass)
117
+ Neutron_mass => 1.67492749804e-27 (Neutron_mass)
118
+ CONSTANTS
119
+ end
120
+
121
+ # @return [Float]
122
+ Electron_mass = (9.1093837015 * ( 10 ** (31 * -1.0 ) ))
123
+
124
+ # @return [Float]
125
+ Proton_mass = (1.67262192369 * ( 10 ** (27 * -1.0 ) ))
126
+
127
+ # @return [Float]
128
+ Neutron_mass = (1.67492749804 * ( 10 ** (27 * -1.0 ) ))
112
129
  end
113
130
  end
@@ -0,0 +1,38 @@
1
+ module PhysicsPlus
2
+ # This class quantums formulas
3
+ class Quantums
4
+ def self.photon_energy(frequency)
5
+ raise 'frequency must be greater than zero' if frequency <= 0
6
+
7
+ Constants::Planck_constant * frequency.to_f
8
+ end
9
+
10
+ def self.photon_momentum(frequency)
11
+ raise 'frequency must be greater than zero' if frequency <= 0
12
+
13
+ Constants::Planck_constant * frequency.to_f / Constants::C
14
+ end
15
+
16
+ def self.einstein_equation_photoelectric_effect(work_function, speed)
17
+ raise 'work function must be greater than zero' if work_function <= 0
18
+
19
+ work_function + (Constants::Electron_mass * speed ** 2)/2.to_f
20
+ end
21
+
22
+ def self.work_function(frequency_min)
23
+ Constants::Planck_constant * frequency_min.abs
24
+ end
25
+
26
+ def self.de_Broglie_wavelength(massa, speed)
27
+ Constants::Planck_constant/(massa.abs * speed.abs)
28
+ end
29
+
30
+ def self.law_of_radioactive_decay(n0, t, half_life)
31
+ n0.to_f * 2 ** (-1 * ( t / half_life.to_f) )
32
+ end
33
+
34
+ def self.equivalence_of_mass_and_energy(massa)
35
+ massa * (Constants::C ** 2)
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  # This module VERSION gem
2
2
  module PhysicsPlus
3
3
  # @return VERSION
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'
5
5
  end
data/lib/physics_plus.rb CHANGED
@@ -2,6 +2,7 @@ require_relative 'physics_plus/constants'
2
2
  require_relative 'physics_plus/optics'
3
3
  require_relative 'physics_plus/version'
4
4
  require_relative 'physics_plus/elements_theory_relativity'
5
+ require_relative 'physics_plus/quantums'
5
6
 
6
7
  # This module is the main one for the gem
7
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: physics_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlexVikPast
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-31 00:00:00.000000000 Z
11
+ date: 2024-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -37,6 +37,7 @@ files:
37
37
  - lib/physics_plus/constants.rb
38
38
  - lib/physics_plus/elements_theory_relativity.rb
39
39
  - lib/physics_plus/optics.rb
40
+ - lib/physics_plus/quantums.rb
40
41
  - lib/physics_plus/version.rb
41
42
  homepage: https://github.com/AlexVikPast/physics_plus
42
43
  licenses:
@@ -58,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
59
  - !ruby/object:Gem::Version
59
60
  version: '0'
60
61
  requirements: []
61
- rubygems_version: 3.4.17
62
+ rubygems_version: 3.5.1
62
63
  signing_key:
63
64
  specification_version: 4
64
65
  summary: physics_plus