Total internal reflection occurs only when light travels from a medium of high refractive index to a medium of low refractive index. This is the case for our problem (glass to air boundary, n=2 and n=1 respectively). Remember that when light moves from a high to a low refractive index, the incident and refracted rays are not parallel - the refracted ray is bent way from the normal to the surface. Now imagine we take the incident ray and increase the angle of incidence until light "bends" inwards.The critical angle is the minimum angle of incidence for which total internal reflection occurs. From Snell's Law we know that: n1 x sin(θ1) = n2 x sin(θ2). Now, setting θ2 = 90deg. (angle of refraction) and rearranging we get: sin(θ-critical) = n2/n1.