This applet is adapted from "Snell's Law" by GeoGebra Tube Team. It demonstrates refraction and reflection of light rays at the interface between two transparent meadia. Users can ajdust the angle of incidence and the two refractive indices. Snell's law determines the angle of incidence. Conservation of power in Maxwell's equations determines the relative intensity of reflection and transmission. No light can be transmitted to a slower medium at less than the "critical angle", with boundary marked by dotted line. Any light pointed to a faster medium from less than the critical angle is wholly reflected at the boundary.
GeoGebra Tube Team notes that relative intensities "are calculated using Equations 2.58, 2.59 on page 44 of Introduction to Modern Optics 2nd Ed., G.R. Fowles, Dover, ISBN 0-486-65957-7. This material is also in Optics, 2nd Ed., E. Hecht, Chapter 4, ISBN 0-201-11609-X."