play phryzby with physics

Any Two Media

solved Refraction

Q. A ray meets the boundary between two media, of indices μ1 and μ2, at 20°i=20°. What do they do to it?

airglassnormalincidentrefracted
Inputs
Outputs
bends toward the normal?yes
bends away from the normal?no
no refracted ray?no

How it's solved

Solved with Refraction

Given

  • i=20°
  • μ1, μ2 yours to vary

Find whether there is bends toward the normal, whether there is bends away from the normal, whether there is no refracted ray.

Working
  1. snells lawμ1⋅sin⁡i=μ2⋅sin⁡rr
  2. 1⋅sin⁡20°=1.5⋅sin⁡rr
  3. rr=13.18°
  4. bends toward the normal?rr<iyes
  5. bends away from the normal?rr>ino
  6. no refracted ray?i>cno
Conclusion

They bend it, and which way follows from which of them is the denser.

The web of concepts

given read from the words equation asked

The Ruby that solves it

The question and its solution are small Ruby files. The engine runs them.

question.rb
1require_relative "../physics"23question :any_two_media do4  describes "A ray meets the boundary between two media, of indices %{first_index} and %{second_index}, at %{angle}. What " \5          "do they do to it?"6  given :first_index7  given :second_index8  given angle: "20 deg"9end
solution.rb
1require_relative "../questions/any_two_media"2require_relative "../science/ray_optics_and_optical_instruments/refraction"34solve :any_two_media, using: Refraction do5  take first_index: :mu_1, second_index: :mu_2, angle: :i6  find_whether :bends_toward_the_normal?7  find_whether :bends_away_from_the_normal?8  find_whether :no_refracted_ray?910  conclusion "They bend it, and which way follows from which of them is the denser."11end
playground.rb
1require_relative "../solutions/any_two_media"2require_relative "../science/ray_optics_and_optical_instruments/refractive_media"3require_relative "../pictures/light"45play_with :any_two_media do6  title "Any Two Media"78  input :from, REFRACTIVE_MEDIA9  input :into, REFRACTIVE_MEDIA, default: "glass"1011  input(:mu_1) { from }12  input(:mu_2) { into }1314  output :bends_toward_the_normal?15  output :bends_away_from_the_normal?16  output :no_refracted_ray?, alarm: true1718  draw Light::Picture do19    media :from, :into20    ray "incident",  arriving_at: :i, extended: true21    ray "refracted", crossing_at: :r_r, unless: :no_refracted_ray?22    note "no refracted ray", when: :no_refracted_ray?23  end24end
The laws it drew on
quantitywrittenunitswithinfrom
angle to the normalθ—0 … 1.571Incidence
angle of incidencei—0 … 1.571Incidence
refractive indexμ——Refraction
angle of refractionrr—0 … 1.571Refraction
refractive index of first mediumμ1——Refraction
refractive index of second mediumμ2——Refraction
critical anglec—0 … 1.571Refraction
i≡θi(before)
angle of incidence
rr≡θi(after)
angle of refraction
μ1≡μb
refractive index of first medium
μ2≡μa
refractive index of second medium
μ1⋅sin⁡i=μ2⋅sin⁡rr
snells law
μ1⋅sin⁡c=μ2⋅sin⁡90°
snells law when grazing exit
rr=90°
grazing exit?
i>c
no refracted ray?
rr<i
bends toward the normal?
rr>i
bends away from the normal?