$\vec T = \vec N \left ( \frac{\eta_1}{\eta_2}\left( \vec E \cdot \vec N\right) \pm \sqrt {1+\left(\frac{\eta_1}{\eta_2}\right)^2\left(\left( \vec E \cdot \vec N \right )^2 -1 \right)}\right) + \frac{\eta_1}{\eta_2} \vec E$
Here T is the transmitted ray, N is the surface normal, E is the incident ray, and $\eta_1$, $\eta_2$ are the indices of refraction.