Refractive Index formula for denser to rarer medium I learnt that the formula for refractive index when light travels from rarer to denser medium is
$$\frac{\sin i }{ \sin r}$$ where 
$i =$ angle of incidence, $r =$ angle of refraction. 
Is the same formula used for calculating refractive index when light travels from denser to rarer medium? Or is it 
$$\frac{\sin r }{ \sin i}$$ in this case?
 A: It is important to note that the equation you mention gives the index of refraction of one medium with respect to another. If light travels from one medium, with refractive index $n_i$ and incident angle $i$, to another medium, with refractive index $n_r$ and refraction angle $r$, then the relationship is described by Snell's Law as such:
$$ n_i\sin(i)=n_r\sin(r)$$ which can be rewritten like this:
$$ {\sin(i) \over \sin(r)} = {n_r \over n_i}$$ If we say that $n_i < n_r$, meaning the light propagates from a rarer to a denser medium, then the above equation gives the index of refraction of the denser medium in relation to the index of refraction of the rarer medium.
If instead we wanted to consider the case where light travels from a denser to rarer medium, then the only change would be that now $n_i > n_r$, in which case the above equation would yield the index of refraction of the rarer medium in relation to the denser medium. Notice that, in this second case, if we still desire the index of the denser medium with respect to the index of the rarer medium, we must rearrange the equation like this:
$$ {\sin(r) \over \sin(i)} = {n_i \over n_r}$$ But this is simply a consequence of which ratio we are looking for. For example, say we consider the propagation of light from air to some unknown denser material. In this case, $n_i \approx 1$ is the index of refraction of air, and $n_r = n_x$ is the index of refraction of the unknown material. We would then say that, from the first relationship defined, the index of refraction of the unknown material is:
$$ n_x = {\sin(i) \over \sin(r)}$$  If instead we said this light traveled from the denser unknown medium to the air, then $n_i= n_x$ and $n_r \approx 1$, in which case we would find the index of the unknown material by using the second relationship:
$$ n_x = {\sin(r) \over \sin(i)}$$
A: The formula for refractive index when light is traveling from denser to lighter medium is
$$\frac{\sin\theta_r}{\sin \theta_i}$$
where $\theta_r$ and $\theta_i$ are the angles of refraction and incidence respectively.
A: The more conventional formula for calculating the refractive index is:
$n_{21}=\frac {\sin x_1}{\sin x_2}$
so basically the refractive index of $n_2$ with respect to $n_1$ equals $\frac{\sin x_1}{\sin x_2}$.
It works for rays originating from both rarer and denser mediums.
