This applet will calculate reflected and refracted light intensity according to the incident angle for p-wave and s-wave.

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/emwaveboundary_pkg/emwaveboundary.propertiesFull screen applet or Problem viewing java?Add to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(1367.8kB):double click downloaded file to run it. (53 times by 35 users) , Download EJS source (7 times by 7 users) View EJS source

Refraction satisfy Snell's law : $n_1 \sin\theta_1=n_2\sin\theta_2$

There are always reflected wave when light touch the boundary between two media.
The intensity for reflected wave $\vec{E}'= r_s \vec{E}_s + r_p \vec{E}_p$ where $\vec{E}_s, \vec{E}_p$ are electric field for s-wave and p-wave.
$r_s= \frac{n_1\cos\theta_1 -n_2\cos\theta_2}{n_1\cos\theta_1 +n_2\cos\theta_2} =\frac{\sin(\theta_1-\theta_2)}{\sin(\theta_1+\theta_2)}$
The intensity of refraction wave is the intensity of incident wave minus intensity of reflected wave.
There is no refracted wave when internal reflection occurs.
When $\theta=\theta=0$, the fraction of reflected wave is $\frac{(n_1-n_2)^2}{(n_1+n_2)^2}$.
for light from air(n=1) to glass (n=1.5), there are only $\frac{(1-1.5)^2}{(1+1.5)^2}=\frac{0.5^2}{2.5^2}=\frac{1}{25}=4%$ light being reflected.