physics_plus 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/physics_plus/elements_theory_relativity.rb +26 -0
- data/lib/physics_plus/optics.rb +2 -2
- data/lib/physics_plus/version.rb +1 -1
- data/lib/physics_plus.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68f215f8775f979e0034ceb43d376dd9b3c2de884e8b2b91e585aa5f6f844002
|
4
|
+
data.tar.gz: ee1abe52951e3eab86e6fb07c3ebe57f3ae297629d4d883d16a14a73d1085ed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151d6de5367201c1e305080b51ce93d447aecfd2b5269545a53df228f009bc5c46986da9aa437dea55ea52c1fe3ef9b5aa803715d5d868db53ada666511cdd56
|
7
|
+
data.tar.gz: 03fad634f23e53c5ef67cf21d7bc330849c27d90f2b64d174e227d882af9be1d0462da3a36e824a804794b42b49296c9f58631b5595e61514c8cae85e2bf5403
|
data/README.md
CHANGED
@@ -41,12 +41,17 @@ puts PhysicsPlus::Constants.List_planck_quantities
|
|
41
41
|
puts PhysicsPlus::Constants.List_different_systems_quantities
|
42
42
|
puts PhysicsPlus::Constants.List_electromagnetic_constants
|
43
43
|
|
44
|
-
|
45
44
|
PhysicsPlus::Constants::C => 299792458
|
46
45
|
PhysicsPlus::Constants::Speed_light_vacuum => 299792458
|
47
46
|
|
48
47
|
PhysicsPlus::Constants::G => 6.02214076e+23
|
49
48
|
PhysicsPlus::Constants::Gravitational_constant => 6.02214076e+23
|
49
|
+
|
50
|
+
PhysicsPlus::Optics.absolute_refractive_index(200_000_000) => 1.49896229
|
51
|
+
PhysicsPlus::Optics.power_lens(2) => 0.5
|
52
|
+
|
53
|
+
PhysicsPlus::ElementsTheoryRelativity.inertial_system_length(1.5, 200_000_000) => 1.1174144036800955
|
54
|
+
PhysicsPlus::ElementsTheoryRelativity.inertial_system_time(60, 200_000_000) => 80.54308205048527
|
50
55
|
```
|
51
56
|
|
52
57
|
|
@@ -55,3 +60,4 @@ PhysicsPlus::Constants::Gravitational_constant => 6.02214076e+23
|
|
55
60
|
MIT
|
56
61
|
|
57
62
|
**Free Software, Hell Yeah!**
|
63
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This module elements theory relativity
|
2
|
+
module PhysicsPlus
|
3
|
+
# This class elements theory relativity formulas
|
4
|
+
class ElementsTheoryRelativity
|
5
|
+
def self.relativistic_velocity_addition(speed_1, speed_2)
|
6
|
+
(speed_1 + speed_2)/(1 + (speed_1 * speed_2.to_f)/Constants::C ** 2 )
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.inertial_system_length(length_0, speed)
|
10
|
+
length_0 * Math.sqrt(1-(speed.to_f ** 2)/(Constants::C ** 2))
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.inertial_system_time(time_0, speed)
|
14
|
+
time_0 / Math.sqrt(1 - (speed.to_f ** 2)/(Constants::C ** 2))
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.inertial_system_weight(weight_0, speed)
|
18
|
+
weight_0 / Math.sqrt(1 - (speed.to_f ** 2)/(Constants::C ** 2))
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.relationship_mass_energy(weight)
|
22
|
+
weight.to_f * (Constants::C ** 2)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
data/lib/physics_plus/optics.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# This module
|
1
|
+
# This module optics
|
2
2
|
module PhysicsPlus
|
3
|
-
# This
|
3
|
+
# This class optics formulas
|
4
4
|
class Optics
|
5
5
|
def self.absolute_refractive_index(speed)
|
6
6
|
raise 'speed must not exceed the speed of light' if Constants::C < speed
|
data/lib/physics_plus/version.rb
CHANGED
data/lib/physics_plus.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require_relative 'physics_plus/constants'
|
2
2
|
require_relative 'physics_plus/optics'
|
3
3
|
require_relative 'physics_plus/version'
|
4
|
+
require_relative 'physics_plus/elements_theory_relativity'
|
4
5
|
|
5
6
|
# This module is the main one for the gem
|
6
7
|
|
7
8
|
module PhysicsPlus
|
8
|
-
end
|
9
|
+
end
|
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.
|
4
|
+
version: 0.0.6
|
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-
|
11
|
+
date: 2023-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- README.md
|
36
36
|
- lib/physics_plus.rb
|
37
37
|
- lib/physics_plus/constants.rb
|
38
|
+
- lib/physics_plus/elements_theory_relativity.rb
|
38
39
|
- lib/physics_plus/optics.rb
|
39
40
|
- lib/physics_plus/version.rb
|
40
41
|
homepage: https://github.com/AlexVikPast/physics_plus
|