Deduction of vector form of Snell's law I was unable to find the deduction of the vector form of Snells's law.
$$n_1\sin\theta_1 = n_2\sin\theta_2$$
Here is the vector form, from the article A Theory of Multi-Layer Flat Refractve Geometry
The formula is referenced to the book: "A. S. Glassner. An Introduction to Ray Tracing. Morgan
Kaufmann, 1989." but I don't have it. Also, I could not find the detuction on the internet.

Anyone can show me how they got here?
 A: Let's say $n$ only has $y$ component. Since $V_i$ and $n$ are linearly independent, $V_{i+1}$ can be written as their linear combination. Note that all $V_i$ and $n$ are unit vectors. (every time you see the name Pythagora take a look at the equation next to it, you will notice that at one point I assumed they are all unit vectors. I was not able to avoid doing that without messing the whole derivation up, so $V_i^TV_i$ in the original expression should just equal $1$. It puzzles me that it is not just dropped in the book, so if anyone sees how this can be done avoiding the unit vector assumption, I would like to know.)
You first write $V_{i+1,x}=a_{i+1}V_{i,x}$, from here $a_{i+1}$ has to be what is stated in the question.
Then you take (2), which is the mentioned linear combination, and only consider $V_{i+1,y}$. That is, $a_{i+1}V_{i,y}+b_{i+1}$. Since $n$ is a unit vector with only $y$ component, $V_{i,y}=V_i^Tn$. Also, $V_{i+1,y}=-\sqrt{1-V_{i+1,x}^2}$ by Pythagora. The minus is just sign convention, there should be a picture in a book somewhere that should clear it up.
We already expressed $V_{i+1,x}=a_{i+1}V_{i,x}$, so $V_{i+1,y}=-\sqrt{1-a_{i+1}^2V_{i,x}^2}=a_{i+1}V_i^Tn+b_{i+1}$.
Now $V_{i,x}^2=V_i^TV_i-(V_i^Tn)^2$, again by Pythagora. This leaves $-\sqrt{1-a_{i+1}^2(V_i^TV_i-(V_i^Tn)^2)}=a_{i+1}V_i^Tn+b_{i+1}$
$b_{i+1}=-a_{i+1}V_i^Tn-\sqrt{1-a_{i+1}^2(V_i^TV_i-(V_i^Tn)^2)}$
which gives the required expression after putting $a_{i+1}=\mu_i/\mu_{i+1}$
