physics 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 Jeff McFadden
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ physics
2
+ =======
3
+
4
+ Utility ruby gem for physics formulae
data/lib/physics.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "physics/fundamental_constants"
2
+ require "physics/classical_mechanics"
3
+ require "physics/general_relativity"
4
+
5
+ module Physics
6
+ end
@@ -0,0 +1,12 @@
1
+ module Physics
2
+ class ClassicalMechanics
3
+
4
+ # Result is in Joules
5
+ # Mass should be kg
6
+ # Velocity should be m/s
7
+ def self.kinetic_energy_of_mass_at_velocity( mass, velocity )
8
+ 0.5 * mass * (velocity **2)
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ module Physics
2
+ class FundamentalConstants
3
+
4
+ def self.speed_of_light_in_vacuum
5
+ 299792458
6
+ end
7
+
8
+ def self.C
9
+ speed_of_light_in_vacuum
10
+ end
11
+
12
+ def self.newtonian_constant_of_gravitation
13
+ 6.67384 * ( 10 ** (11 * -1.0 ) )
14
+ end
15
+
16
+ def self.G
17
+ newtonian_constant_of_gravitation
18
+ end
19
+
20
+ def self.plank_constant
21
+ 6.62606957 * ( 10 ** (34 * -1.0) )
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module Physics
2
+ class GeneralRelativity
3
+
4
+ def self.energy_of_mass( mass )
5
+ mass * ( Physics::FundamentalConstants.C ** 2 )
6
+ end
7
+
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Physics
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: physics
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jeff McFadden
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-26 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Physics formulae covering classical mechanics, general relativity, fundamental
15
+ constants, and more.
16
+ email:
17
+ - jeff.mcfadden@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/physics/classical_mechanics.rb
23
+ - lib/physics/fundamental_constants.rb
24
+ - lib/physics/general_relativity.rb
25
+ - lib/physics/version.rb
26
+ - lib/physics.rb
27
+ - MIT-LICENSE
28
+ - README.md
29
+ homepage: https://www.github.com/jeffmcfadden/physics
30
+ licenses: []
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubyforge_project:
49
+ rubygems_version: 1.8.23
50
+ signing_key:
51
+ specification_version: 3
52
+ summary: Physics formulae.
53
+ test_files: []