# What is Snell's law's main formula?

My book states it as $$(\sin i)/(\sin r)=n$$. However, University Physics has a different say. It says, $$n_{a} \sin a =n_{b} \sin b$$. Which of the following is correct?

$$n_1Sin(\theta_1)=n_2Sin(\theta_2)$$
Where $$n_1$$ is the index of refraction of the medium of the incident ray, $$n_2$$ the index of refraction of the medium of the refracted ray, and $$\theta_1$$ and $$\theta_2$$ are the angles of the incident and refracted rays, respectively (with respect to the normal plane of refraction).
The first equation you have is a particular case where $$n_1=1$$, which is approximately the index of refraction of the air (many problems you'll encounter assume the incident ray comes from a medium of air)