# Reflection Vector (Ray Tracing)

Snell's law of refraction at the interface between 2 isotropic media is given by the equation: \begin{align} \tag{1} n_1 \,\text{sin} \,\theta_1 = n_2 \, \text{sin}\,\theta_2 \end{align}

$$\qquad$$ where $$\theta_1$$ is the angle of incidence and $$\theta_2$$ the angle of refraction. $$n_1$$ is the refractive index of the optical medium in front of the interface and $$n_2$$ is the refractive index of the optical medium behind the interface.

Eq.(1) can be expressed in vector form as $$$$\tag{2} n_1(\textbf{i} \times \textbf{n}) = n_2 (\textbf{t} \times \textbf{n})$$$$ $$\qquad$$ where $$\textbf{i}$$ and $$\textbf{t}$$ are the unit directional vector of the incident and transmitted ray respectively. $$\textbf{n}$$ is the unit normal vector to the interface between the two media pointing from medium 1 with refractive index $$n_1$$ into medium 2 with refractive index $$n_2$$. Similarly $$\textbf{r}$$ is the reflected ray vector.

How can the equation \begin{align}\tag{3} \textbf{t} = \mu \textbf{i} + n\sqrt{1- \mu^2[1-(\textbf{ni})^2]} - \mu \textbf{n}(\textbf{ni}) \end{align} be used to derive the equation $$$$\tag{4} \textbf{n} = \dfrac{\textbf{i}-\textbf{r}}{\sqrt{2[1-(\textbf{i}\textbf{r})]}}?$$$$

$$\qquad$$Here $$\mu = \dfrac{n_1}{n_2}$$ and $$\textbf{n}\textbf{i}= n_{\text{x}} i_{\text{x}} + n_{\text{y}}i_{\text{y}} + n_{\text{z}} i_{\text{z}}$$ denotes the dot (scalar) product of vectors $$\textbf{n}$$ and $$\textbf{i}$$.

In Ref.[1] it says that from Eq.(3) follows \begin{align}\tag{5} \textbf{r} = \textbf{i} - 2\textbf{n}(\textbf{n}\textbf{i}) \end{align} By simple modification \begin{align}\tag{6} \textbf{n} = \dfrac{\textbf{i}-\textbf{r}}{2(\textbf{n}\textbf{i})} \end{align} It says that "...by calculating the dot products of vector $$\textbf{n}$$ with both sides of Eq.(6), one can express the dot product $$(\textbf{n}\textbf{i})$$ in the form as shown in Eq.(4)" which I can't follow )=

Could someone explain how equation (4) is derived?

References:

1. Antonín Mikš and Pavel Novák, Determination of unit normal vectors of aspherical surfaces given unit directional vectors of incoming and outgoing rays: comment, 2012 Optical Society of America, page 1356

I wonder why all this Physics stuff (refraction, reflection, Snell's Law etc) in order to ask a pure simple mathematical question in Vector Calculus : that of the normalization of a vector.

$$$$\mathbf{n}\boldsymbol{=}\dfrac{\mathbf{i}\boldsymbol{\!-\!}\mathbf{r}}{\Vert\mathbf{i}\boldsymbol{\!-\!}\mathbf{r}\Vert} \tag{01}\label{01}$$$$

$$$$\Vert\mathbf{i}\boldsymbol{\!-\!}\mathbf{r}\Vert^{\bf 2}\boldsymbol{=}\Vert\mathbf{i}\Vert^{\bf 2}\boldsymbol{+}\Vert\mathbf{r}\Vert^{\bf 2}\boldsymbol{-}2(\mathbf{i}\boldsymbol{\cdot}\mathbf{r})=1\boldsymbol{+}1\boldsymbol{-}2(\mathbf{i}\boldsymbol{\cdot}\mathbf{r})\boldsymbol{=}2\left[1\boldsymbol{-}(\mathbf{i}\boldsymbol{\cdot}\mathbf{r})\right] \tag{02}\label{02}$$$$ that is $$$$\Vert\mathbf{i}\boldsymbol{\!-\!}\mathbf{r}\Vert\boldsymbol{=}\sqrt{2\left[1\boldsymbol{-}(\mathbf{i}\boldsymbol{\cdot}\mathbf{r})\right]\vphantom{\frac12}} \tag{03}\label{03}$$$$ so $$$$\mathbf{n}\boldsymbol{=}\dfrac{\mathbf{i}\boldsymbol{\!-\!}\mathbf{r}}{\sqrt{2\left[1\boldsymbol{-}(\mathbf{i}\boldsymbol{\cdot}\mathbf{r})\right]\vphantom{\frac12}}} \tag{04}\label{04}$$$$

$$=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=$$

EDIT

$$$$\left. \begin{cases} \mathbf{n}\boldsymbol{\cdot}\mathbf{i}\boldsymbol{=}\cos\theta\\ \:\mathbf{i}\boldsymbol{\cdot}\mathbf{r}\boldsymbol{=}\cos(\pi\!\boldsymbol{-}\!2\theta)\!\boldsymbol{=}\!\boldsymbol{-}\!\cos2\theta \end{cases}\!\! \right\} \stackrel{\cos2\theta\boldsymbol{=}2\cos^{2}\theta\boldsymbol{-}1}{\boldsymbol{=\!=\!=\!=\!=\!=\!=\!=\!\Longrightarrow}}\boldsymbol{-}(\mathbf{i}\boldsymbol{\cdot}\mathbf{r})\boldsymbol{=}2(\mathbf{n}\boldsymbol{\cdot}\mathbf{i})^{2}\!\boldsymbol{-}\!1 \tag{05}\label{05}$$$$ that's why your equation (6) $$$$\mathbf{n}\boldsymbol{=}\dfrac{\mathbf{i}\!\boldsymbol{-}\!\mathbf{r}}{2(\mathbf{n}\!\boldsymbol{\cdot}\!\mathbf{i})} \tag{06}\label{06}$$$$

$$=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=$$

Related : Snell's law in vector form