Method: Joules.magnification
- Defined in:
- lib/joules/waves.rb
.magnification(image_height, object_height) ⇒ Float
Calculates the magnification given image height and object height.
163 164 165 166 167 168 169 |
# File 'lib/joules/waves.rb', line 163 def magnification(image_height, object_height) if object_height.zero? raise ZeroDivisionError.new('divided by 0') else return image_height / object_height.to_f end end |