N1 and n2 are refractive indices wrt vacuum.
we know that n1 sin i = n2 sin r --- this is derived by using the Huygens principle of light being waves and traveling as a wavefront.
when the angle of incidence at the interface between the two media is equal to ic, critical angle, then the light ray grazes the interface between the two media.
hence, the angle of refraction = 90 deg.
n2 / n1 = sin i / sin r = sin ic / sin 90 = sin ic
It is not clear if the derivation regarding the law n2 sin r = n1 sin i is to be done using Huygens wavefronts..
Let us take two points (secondary wavefronts) on the same wavefront in medium 1. We can treat a large spherical wavefront to be approximately planar in a small region. The wavefront travels v1 * t distance in t seconds in medium 1. We take a wavefront perpendicular to the light ray. Thus the wavefront plane is inclined at angle i to the surface of separation, same angle of incidence i between the light ray and the normal.
After the refraction in to the second medium, the secondary wavefront that enters the secondary medium travels v2 * t and it makes an angle r, with the surface of separation. r is also the angle of refraction of light ray with normal to the surface.
Thus v1 t / sin i = v2 t / sin r = AB
=> v1 / v2 = sin i / sin r
v1 = c / n1 and n2 = c/ v2
so we get v1 / v2 = n2 / n1 = sin i / sin r