Method: Joules.tensile_strain
- Defined in:
- lib/joules/stress_strain.rb
.tensile_strain(extension, length) ⇒ Float
Calculates the tensile strain given extension and length.
44 45 46 47 48 49 50 |
# File 'lib/joules/stress_strain.rb', line 44 def tensile_strain(extension, length) if length.zero? raise ZeroDivisionError.new('divided by 0') else return extension / length.to_f end end |