play phryzby with physics

Refraction: Air to Water

solved Refraction

Q. Where does a ray go when it passes from airμ1=1 into waterμ2=1.33 at i?

airwaternormalincident60.0°refracted40.6°
Inputs
i
60.00°
Outputs
angle of refractionrr40.63°

How it's solved

Solved with Refraction

Given

  • μ1=1 from “air”
  • μ2=1.33 from “water”
  • i yours to vary

Find rr.

Working
  1. snells lawμ1⋅sin⁡i=μ2⋅sin⁡rr
  2. 1⋅sin⁡60°=1.33⋅sin⁡rr
  3. rr=40.63°
Conclusion

It goes through, and bends toward the normal doing so. The two angles are neither equal nor proportional: what each medium does to the sine of its own angle, the other undoes.

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 :refraction do4  describes "%{refracted} when it passes from air into water at %{angle}?"5  given :angle6  asks refracted: "Where does a ray go"7end
solution.rb
1require_relative "../questions/refraction"2require_relative "../science/ray_optics_and_optical_instruments/refraction"3require_relative "../science/ray_optics_and_optical_instruments/refractive_media"45solve :refraction, using: Refraction do6  take angle: :i7  deduce_from "air", mu_1: REFRACTIVE_MEDIA.fetch("air")8  deduce_from "water", mu_2: REFRACTIVE_MEDIA.fetch("water")9  take refracted: :r_r10  find_value :refracted1112  conclusion "It goes through, and bends toward the normal doing so. The two angles are neither equal nor proportional: what each medium does to the sine of its own angle, the other undoes."13end
playground.rb
1require_relative "../solutions/refraction"2require_relative "../science/ray_optics_and_optical_instruments/refractive_media"3require_relative "../pictures/light"45play_with :refraction do6  title "Refraction: Air to Water"78  input :i, default: 60.deg910  output :r_r1112  draw Light::Picture do13    media "air", "water"14    ray "incident",  arriving_at: :i,  angle: true, extended: true15    ray "refracted", crossing_at: :r_r, angle: true16  end17end
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?