Method: Joules.electric_field_strength_v1
- Defined in:
- lib/joules/electric_fields.rb
.electric_field_strength_v1(voltage, distance) ⇒ Float
Note:
There are two other method for calculating electric field strength.
Calculates the electric field strength given voltage and distance between two plates.
27 28 29 30 31 32 33 |
# File 'lib/joules/electric_fields.rb', line 27 def electric_field_strength_v1(voltage, distance) if distance.zero? raise ZeroDivisionError.new('divided by 0') else return voltage / distance.to_f end end |