What i know about snell's law: It is applied when a ray of light meets the interface of some other medium and we can find the fourth quantity if we know any of the three quantities in the following relation
$u_isin(i)=u_rsin(r)$
where $u_i$ & $u_r$ is refractive index of incident & refractive medium respectively and $sin(i) , sin(r)$ are angle the ray of light makes with the normal to the interface in incidence medium and refractive medium respectively
What I want to ask:Can the snell's law be applied (in the case where a ray of light is incident with some angle on the rectangular slab whose refractive index changes with depth of the rectangular slab and refractive index has a linear relation with depth of the slab),between the points,the initial point of contact of ray of light with the slab and the point at some depth say x in the slab considering we know the angle of refraction the light ray makes at depth x.