example.refraction.snell¶
- example.refraction.snell(theta_inc, n1, n2)[source]¶
Compute the refraction angle using Snell’s Law.
See https://en.wikipedia.org/wiki/Snell%27s_law
- Parameters:
- theta_incfloat
Incident angle in radians.
- n1, n2float
The refractive index of medium of origin and destination medium.
- Returns:
- thetafloat
refraction angle
Examples
A ray enters an air–water boundary at pi/4 radians (45 degrees). Compute exit angle.
>>> snell(np.pi/4, 1.00, 1.33) 0.5605584137424605