joules 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTING.md +74 -0
- data/README.md +4 -4
- data/lib/joules.rb +1 -1
- data/lib/joules/circular_motion.rb +5 -5
- data/lib/joules/constants.rb +3 -3
- data/lib/joules/conversion.rb +2 -2
- data/lib/joules/density.rb +2 -2
- data/lib/joules/electric_fields.rb +1 -1
- data/lib/joules/electricity.rb +2 -2
- data/lib/joules/energy_work_power.rb +2 -2
- data/lib/joules/forces.rb +2 -2
- data/lib/joules/geometry.rb +6 -6
- data/lib/joules/gravitational_fields.rb +1 -1
- data/lib/joules/kinematics.rb +2 -2
- data/lib/joules/magnetic_fields.rb +1 -1
- data/lib/joules/mass_weight.rb +2 -2
- data/lib/joules/momentum_impulse.rb +1 -1
- data/lib/joules/oscillations.rb +2 -2
- data/lib/joules/pressure.rb +2 -2
- data/lib/joules/quantum.rb +1 -1
- data/lib/joules/stress_strain.rb +3 -3
- data/lib/joules/thermodynamics.rb +1 -1
- data/lib/joules/waves.rb +2 -2
- data/test/test_joules.rb +2 -2
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fa6d4e049d98465e2aee9e2a6eb52a2c2b51be3
|
4
|
+
data.tar.gz: 2ed2e3097bfb314308a4cff1818ed22dfcea9287
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 080419812694ae0ed5eae62674e2c5b788617e4e2d3e92dc480563a79874c62124b5bee330a96d11ed78598c7eeb368c66ee5bd1c24cf4d152ec79cd32372cc6
|
7
|
+
data.tar.gz: ebbab7100a001d5b9898a0974a37dbf304fe432bef2d4002d7a75964b67618a9df12721c24b27206f1f4e1dc36c14e31977486d175d6b66545705841e05e6276
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
## Contributing to Joules
|
2
|
+
In order to make Joules better, **everyone** is encouraged to help improve this project. Before diving into the code, please familiarize yourself with the following guidelines and conventions.
|
3
|
+
|
4
|
+
### Getting Started
|
5
|
+
1. Install the [Ruby programming language](https://www.ruby-lang.org/en/documentation/installation/) for your platform.
|
6
|
+
2. [Fork](https://help.github.com/articles/fork-a-repo/) the project.
|
7
|
+
|
8
|
+
```Bash
|
9
|
+
# Clone your fork of the repository into the current directory
|
10
|
+
git clone https://github.com/<your-username>/Joules
|
11
|
+
# Navigate to the newly cloned directory
|
12
|
+
cd <repo-name>
|
13
|
+
# Assign the original repository to a remote called "upstream"
|
14
|
+
git remote add upstream git://github.com/elailai94/Joules
|
15
|
+
```
|
16
|
+
3. Get the latest changes from upstream if you forked awhile ago.
|
17
|
+
|
18
|
+
```Bash
|
19
|
+
git checkout master
|
20
|
+
git pull upstream master
|
21
|
+
```
|
22
|
+
|
23
|
+
4. Run all tests.
|
24
|
+
|
25
|
+
```Bash
|
26
|
+
rake test
|
27
|
+
```
|
28
|
+
|
29
|
+
### Ways to Contribute
|
30
|
+
Here are some ways you can contribute:
|
31
|
+
* by using alpha, beta, and pre-release versions
|
32
|
+
* by reporting bugs
|
33
|
+
* by suggesting new features
|
34
|
+
* by writing or editing documentation
|
35
|
+
* by writing code
|
36
|
+
* by refactoring code
|
37
|
+
* by closing [issues](https://www.github.com/elailai94/Joules/issues)
|
38
|
+
|
39
|
+
### Issues
|
40
|
+
The [GitHub issue tracker](https://www.github.com/elailai94/Joules/issues) is used to track bugs and features.
|
41
|
+
#### Bug Reports
|
42
|
+
When submitting a bug report, please use the following guidelines:
|
43
|
+
|
44
|
+
1. **Use the GitHub issue search** to check if the bug has already been reported.
|
45
|
+
2. **Check if the issue has been fixed** by trying to reproduce it using the latest master in the repository.
|
46
|
+
3. **Isolate the problem** by creating a reduced test case and a live example.
|
47
|
+
4. **Elaborate as much as possible in your report** by including specific information about the environment (e.g.: operating system and version, library (gem) version, etc.) and steps required to reproduce the issue.
|
48
|
+
|
49
|
+
#### Feature Requests
|
50
|
+
When submitting a feature request, please use the following guidelines:
|
51
|
+
|
52
|
+
1. **Use the GitHub issue search** to check if the feature has already been suggested.
|
53
|
+
2. **Check if the feature has been introduced** by trying to test for it using the latest *master* in the repostory.
|
54
|
+
3. **Elaborate as much as possible in your report** by providing as much detail and context as possible on why your idea fits the scope and aims of the project.
|
55
|
+
|
56
|
+
> Note: Contribution enquiries should take place before any significant pull request. Otherwise, you risk spending a lot of time working on something that might be rejected for good reasons.
|
57
|
+
|
58
|
+
### Pull Requests
|
59
|
+
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project.
|
60
|
+
2. Create a topic branch.
|
61
|
+
3. Implement your feature or bug fix.
|
62
|
+
4. Add documentation for your feature or bug fix.
|
63
|
+
5. Run ```rake doc:yard``` or ```yard doc```. If your changes are not 100% documented, go back to step 4.
|
64
|
+
6. Commit and push your changes.
|
65
|
+
7. Submit a [pull request](https://help.github.com/articles/using-pull-requests/) with a clear title and description. Please do not include changes to the gemspec or changelog file. (If you want to create your own version for some reason, please do so in a separate commit.)
|
66
|
+
|
67
|
+
### Coding Convention
|
68
|
+
Although there is currently no strict set of coding or style guidelines, it is advised that you use common sense when contributing code and make an effort to use a similar style to nearby existing code. It is strongly recommended that you read through the [Ruby style guide](https://www.github.com/styleguide/ruby).
|
69
|
+
|
70
|
+
### Documentation Convention
|
71
|
+
The [YARD documentation style](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md) is used to document code.
|
72
|
+
|
73
|
+
### License
|
74
|
+
By contributing to Joules, you agree that your contributions will be licensed under its [MIT license](https://www.github.com/elailai94/Joules/blob/master/LICENSE.md).
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ gem build joules.gemspec
|
|
17
17
|
|
18
18
|
### Library Installation
|
19
19
|
```Bash
|
20
|
-
gem install joules-0.4.
|
20
|
+
gem install joules-0.4.4.gem
|
21
21
|
```
|
22
22
|
|
23
23
|
### Library Import
|
@@ -38,8 +38,8 @@ Joules.power(Joules.work_done(40, 2.34), 4)
|
|
38
38
|
This would return 23.4.
|
39
39
|
> Note: For documentation on usage of methods and constants, please visit [http://www.rubydoc.info/gems/joules/](http://www.rubydoc.info/gems/joules/).
|
40
40
|
|
41
|
-
###
|
42
|
-
|
41
|
+
### Contributing
|
42
|
+
In order to make Joules better, **everyone** is encouraged to help improve this project. Before diving into the code, please familiarize yourself with the [Guide to Contributing](https://www.github.com/elailai94/Joules/blob/master/CONTRIBUTING.md).
|
43
43
|
|
44
44
|
### License
|
45
|
-
* Joules is licensed under the [MIT license](https://github.com/elailai94/Joules/blob/master/LICENSE.md).
|
45
|
+
* Joules is licensed under the [MIT license](https://www.github.com/elailai94/Joules/blob/master/LICENSE.md).
|
data/lib/joules.rb
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing circular motion formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Circular motion module (circular_motion.rb)
|
10
10
|
|
11
11
|
module Joules
|
12
12
|
module_function
|
13
|
-
|
13
|
+
|
14
14
|
# @!group Circular Motion Methods
|
15
15
|
|
16
16
|
# Calculates the angular velocity given linear velocity and radius.
|
@@ -23,7 +23,7 @@ module Joules
|
|
23
23
|
# @raise [ZeroDivisionError] if radius = 0
|
24
24
|
# @example
|
25
25
|
# Joules.angular_velocity_v1(9, 3) #=> 3.0
|
26
|
-
# @note There is one other method for calculating angular velocity.
|
26
|
+
# @note There is one other method for calculating angular velocity.
|
27
27
|
def angular_velocity_v1(linear_velocity, radius)
|
28
28
|
if radius.zero?
|
29
29
|
raise ZeroDivisionError.new('divided by 0')
|
@@ -39,7 +39,7 @@ module Joules
|
|
39
39
|
# return value >= 0; return value is in radians per second
|
40
40
|
# @example
|
41
41
|
# Joules.angular_velocity_v2(1.5) #=> 9.42477796076938
|
42
|
-
# @note There is one other method for calculating angular velocity.
|
42
|
+
# @note There is one other method for calculating angular velocity.
|
43
43
|
def angular_velocity_v2(frequency_of_rotation)
|
44
44
|
return 2 * Math::PI * frequency_of_rotation
|
45
45
|
end
|
@@ -114,7 +114,7 @@ module Joules
|
|
114
114
|
raise ZeroDivisionError.new('divided by 0')
|
115
115
|
else
|
116
116
|
return (mass * (linear_velocity ** 2.0)) / radius
|
117
|
-
end
|
117
|
+
end
|
118
118
|
end
|
119
119
|
|
120
120
|
# Calculates the centripetal force given mass, angular velocity, and radius.
|
data/lib/joules/constants.rb
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing constants
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Constants module (constants.rb)
|
10
10
|
|
11
11
|
module Joules
|
12
|
-
|
12
|
+
|
13
13
|
# Speed of light in free space.
|
14
14
|
# @note This quantity is in metres per second.
|
15
15
|
SPEED_OF_LIGHT = 3.00e8
|
@@ -51,7 +51,7 @@ module Joules
|
|
51
51
|
MOLAR_GAS_CONSTANT = 8.31
|
52
52
|
|
53
53
|
# Avogadro constant.
|
54
|
-
# @note This quantity is in per mole.
|
54
|
+
# @note This quantity is in per mole.
|
55
55
|
AVOGADRO_CONSTANT = 6.02e23
|
56
56
|
|
57
57
|
# Boltzmann constant.
|
data/lib/joules/conversion.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing conversion formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Conversion module (conversion.rb)
|
@@ -71,7 +71,7 @@ module Joules
|
|
71
71
|
# @return [Float]
|
72
72
|
# return value is in metres per second
|
73
73
|
# @example
|
74
|
-
# Joules.to_metres_per_second(200) #=> 55.55555555555556
|
74
|
+
# Joules.to_metres_per_second(200) #=> 55.55555555555556
|
75
75
|
def to_metres_per_second(velocity)
|
76
76
|
return (velocity * 1000) / 3600.0
|
77
77
|
end
|
data/lib/joules/density.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing density formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Density module (density.rb)
|
@@ -20,7 +20,7 @@ module Joules
|
|
20
20
|
# volume > 0; volume is in metres cubed
|
21
21
|
# @return [Float]
|
22
22
|
# return value >= 0; return value is in kilograms per metre cubed
|
23
|
-
# @raise [ZeroDivisionError] if volume = 0
|
23
|
+
# @raise [ZeroDivisionError] if volume = 0
|
24
24
|
# @example
|
25
25
|
# Joules.density(8.96, 0.002) #=> 4480.0
|
26
26
|
def density(mass, volume)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing electric fields formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Electric fields module (electric_fields.rb)
|
data/lib/joules/electricity.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing electricity formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Electricity module (electricity.rb)
|
@@ -115,7 +115,7 @@ module Joules
|
|
115
115
|
def resistance_in_parallel(resistances)
|
116
116
|
total_resistance = 0
|
117
117
|
if resistances.empty?
|
118
|
-
return total_resistance.to_f
|
118
|
+
return total_resistance.to_f
|
119
119
|
else
|
120
120
|
resistances.each do |resistance|
|
121
121
|
total_resistance += (1.0 / resistance)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing energy, work, and power formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Energy, work, and power module (energy_work_power.rb)
|
@@ -112,7 +112,7 @@ module Joules
|
|
112
112
|
# return value >= 0
|
113
113
|
# @raise [ZeroDivisionError] if energy_input = 0
|
114
114
|
# @example
|
115
|
-
# Joules.energy_efficiency(16, 20) #=> 80.0
|
115
|
+
# Joules.energy_efficiency(16, 20) #=> 80.0
|
116
116
|
def energy_efficiency(useful_energy_output, energy_input)
|
117
117
|
if energy_input.zero?
|
118
118
|
raise ZeroDivisionError.new('divided by 0')
|
data/lib/joules/forces.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing forces formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Forces module (forces.rb)
|
@@ -22,7 +22,7 @@ module Joules
|
|
22
22
|
# return value is in newtons
|
23
23
|
# @example
|
24
24
|
# Joules.force_v1(120, 2.67) #=> 320.4
|
25
|
-
# @note There are two other methods for calculating force.
|
25
|
+
# @note There are two other methods for calculating force.
|
26
26
|
def force_v1(mass, acceleration)
|
27
27
|
return mass * acceleration.to_f
|
28
28
|
end
|
data/lib/joules/geometry.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing geometry formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Geometry module (geometry.rb)
|
@@ -36,7 +36,7 @@ module Joules
|
|
36
36
|
# @return [Float]
|
37
37
|
# return value >= 0; return value has the same units as radius
|
38
38
|
# @example
|
39
|
-
# Joules.circumference(12) #=> 75.398223686155
|
39
|
+
# Joules.circumference(12) #=> 75.398223686155
|
40
40
|
def circumference(radius)
|
41
41
|
return 2 * Math::PI * radius
|
42
42
|
end
|
@@ -79,7 +79,7 @@ module Joules
|
|
79
79
|
# @param width [Int, Float]
|
80
80
|
# width >= 0; width has the same units as length
|
81
81
|
# @return [Float]
|
82
|
-
# return value >= 0; return value has the same units squared as length
|
82
|
+
# return value >= 0; return value has the same units squared as length
|
83
83
|
# @example
|
84
84
|
# Joules.rectangle_area(2, 3.4) #=> 6.8
|
85
85
|
def rectangle_area(length, width)
|
@@ -92,7 +92,7 @@ module Joules
|
|
92
92
|
# @return [Float]
|
93
93
|
# return value >= 0; return value has the same units squared as radius
|
94
94
|
# @example
|
95
|
-
# Joules.circle_area(12) #=> 452.38934211693
|
95
|
+
# Joules.circle_area(12) #=> 452.38934211693
|
96
96
|
def circle_area(radius)
|
97
97
|
return Math::PI * (radius ** 2)
|
98
98
|
end
|
@@ -133,7 +133,7 @@ module Joules
|
|
133
133
|
# @return [Float]
|
134
134
|
# return value >= 0; return value has the same units cubed as radius
|
135
135
|
# @example
|
136
|
-
# Joules.cylinder_volume(6.5, 3) #=> 398.196868842506
|
136
|
+
# Joules.cylinder_volume(6.5, 3) #=> 398.196868842506
|
137
137
|
def cylinder_volume(radius, height)
|
138
138
|
return circle_area(radius) * height
|
139
139
|
end
|
@@ -179,6 +179,6 @@ module Joules
|
|
179
179
|
return circumference(radius) * height
|
180
180
|
end
|
181
181
|
|
182
|
-
# @!group
|
182
|
+
# @!group
|
183
183
|
|
184
184
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing gravitational fields formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Gravitational fields module (gravitational_fields.rb)
|
data/lib/joules/kinematics.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing kinematics formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Kinematics module (kinematics.rb)
|
@@ -40,7 +40,7 @@ module Joules
|
|
40
40
|
# return value is in metres per second
|
41
41
|
# @raise [ZeroDivisionError] if time = 0
|
42
42
|
# @example
|
43
|
-
# Joules.avg_velocity(180, 4.8) #=> 37.5
|
43
|
+
# Joules.avg_velocity(180, 4.8) #=> 37.5
|
44
44
|
def avg_velocity(displacement, time)
|
45
45
|
if time.zero?
|
46
46
|
raise ZeroDivisionError.new('divided by 0')
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing magnetic fields formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Magnetic fields module (magnetic_fields.rb)
|
data/lib/joules/mass_weight.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing mass and weight formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Mass and weight module (mass_weight.rb)
|
@@ -21,7 +21,7 @@ module Joules
|
|
21
21
|
# @example
|
22
22
|
# Joules.weight(79.41) #=> 779.0121
|
23
23
|
def weight(mass)
|
24
|
-
return mass * FREE_FALL_ACCELERATION
|
24
|
+
return mass * FREE_FALL_ACCELERATION
|
25
25
|
end
|
26
26
|
|
27
27
|
# Calculates the mass given weight.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing momentum and impulse formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Momentum and impulse module (momentum_impulse.rb)
|
data/lib/joules/oscillations.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing oscillations formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Oscillations module (oscillations.rb)
|
@@ -24,7 +24,7 @@ module Joules
|
|
24
24
|
# Joules.particle_acceleration(2.4, 3) #=> -17.28
|
25
25
|
# @note There is one other method for calculating acceleration.
|
26
26
|
def particle_acceleration(angular_velocity, particle_displacement)
|
27
|
-
return (- (angular_velocity ** 2.0) *
|
27
|
+
return (- (angular_velocity ** 2.0) * particle_displacement)
|
28
28
|
end
|
29
29
|
|
30
30
|
# Calculates the displacement of a particle in oscillation given amplitude, angular velocity, and time.
|
data/lib/joules/pressure.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing pressure formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Pressure module (pressure.rb)
|
@@ -22,7 +22,7 @@ module Joules
|
|
22
22
|
# return value >= 0; return value is in pascals
|
23
23
|
# @raise [ZeroDivisionError] if area = 0
|
24
24
|
# @example
|
25
|
-
# Joules.pressure(98, 0.04) #=> 2450.0
|
25
|
+
# Joules.pressure(98, 0.04) #=> 2450.0
|
26
26
|
def pressure(force, area)
|
27
27
|
if area.zero?
|
28
28
|
raise ZeroDivisionError.new('divided by 0')
|
data/lib/joules/quantum.rb
CHANGED
data/lib/joules/stress_strain.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing stress and strain formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Stress and strain module (stress_strain.rb)
|
@@ -38,7 +38,7 @@ module Joules
|
|
38
38
|
# length > 0; length is in metres
|
39
39
|
# @return [Float]
|
40
40
|
# return value >= 0
|
41
|
-
# @raise [ZeroDivisionError] if length = 0
|
41
|
+
# @raise [ZeroDivisionError] if length = 0
|
42
42
|
# @example
|
43
43
|
# Joules.tensile_strain(2, 10) #=> 0.2
|
44
44
|
def tensile_strain(extension, length)
|
@@ -66,7 +66,7 @@ module Joules
|
|
66
66
|
return tensile_stress / tensile_strain.to_f
|
67
67
|
end
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
# @!endgroup
|
71
71
|
|
72
72
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing thermodynamics formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Thermodynamics module (thermodynamics.rb)
|
data/lib/joules/waves.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for providing waves formulas
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Waves module (waves.rb)
|
@@ -159,7 +159,7 @@ module Joules
|
|
159
159
|
# return value >= 0
|
160
160
|
# @raise [ZeroDivisionError] if object_height = 0
|
161
161
|
# @example
|
162
|
-
# Joules.magnification(10, 5) #=> 2.0
|
162
|
+
# Joules.magnification(10, 5) #=> 2.0
|
163
163
|
def magnification(image_height, object_height)
|
164
164
|
if object_height.zero?
|
165
165
|
raise ZeroDivisionError.new('divided by 0')
|
data/test/test_joules.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# @description: Module for testing the Joules module
|
5
5
|
# @author: Elisha Lai
|
6
|
-
# @version: 0.4.
|
6
|
+
# @version: 0.4.4 05/07/2015
|
7
7
|
#==============================================================================
|
8
8
|
|
9
9
|
# Testing module for joules.rb (test_joules.rb)
|
@@ -35,7 +35,7 @@ class CircularMotionTests < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_angular_velocity_v1_example
|
38
|
-
|
38
|
+
assert_in_epsilon(3, angular_velocity_v1(9, 3), EPSILON)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
metadata
CHANGED
@@ -1,24 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: joules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elisha Lai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
15
|
-
|
13
|
+
description: |2
|
14
|
+
Joules is a library (gem) for providing simple Physics formulas
|
15
|
+
in kinematics, forces, waves, electricity, and so much more. A
|
16
|
+
selection of fundamental constants are also provided. It is
|
17
|
+
written entirely in Ruby.
|
16
18
|
email: elisha.lai@outlook.com
|
17
19
|
executables: []
|
18
20
|
extensions: []
|
19
21
|
extra_rdoc_files: []
|
20
22
|
files:
|
21
23
|
- CHANGELOG.md
|
24
|
+
- CONTRIBUTING.md
|
22
25
|
- LICENSE.md
|
23
26
|
- README.md
|
24
27
|
- lib/joules.rb
|