Method: Joules.refractive_index_v1
- Defined in:
- lib/joules/waves.rb
.refractive_index_v1(angle_of_incidence, angle_of_refraction) ⇒ Float
Note:
There is one other method for calculating refractive index.
Calculates the refractive index of a substance given angle of incidence and angle of refraction.
128 129 130 131 132 133 134 135 |
# File 'lib/joules/waves.rb', line 128 def refractive_index_v1(angle_of_incidence, angle_of_refraction) if angle_of_refraction.zero? raise ZeroDivisionError.new('divided by 0') else return Math.sin(to_radians(angle_of_incidence)) / Math.sin(to_radians(angle_of_refraction)) end end |