Analytic Ray Tracing

Analytic Ray Tracing

In the previous sections we've done some work with ray tracing. We have used two facts to trace rays through optical systems: 1) A ray incident on a lens after passing through its front focal point will emerge from the lens parallel to the central axis and 2) A ray passing through the center of the optic is undeviated.

In this section we develop a much more useful (and rigorous) tool for tracing rays through general optical systems. In the derivations that follow we again assume paraxial propagation and therefore will take

LaTeX: \sin (\theta )\approx \tan (\theta )\approx \thetasin(θ)tan(θ)θ

and

LaTeX: \cos (\theta )\approx 1cos(θ)1

Ray Transfer Matrices: Free Space Matrix

Consider the following diagram:

Free Space Matrix Diagram

The figure above shows a simple system consisting of a ray propagating in free space over a distance LaTeX: d\equiv z_2-z_1dz2z1. The input ray is characterized by its initial deviation from the z-axis and its angle of propagation w.r.t. the z-axis.

Positive angles are measured counter-clockwise (ccw) from the z-axis. Using this figure, we can write a simple equation to solve for the output angle and output deviation from the z-axis as

LaTeX: x_2=x_1+\left(z_2-z_1\right) \tan (\gamma )x2=x1+(z2z1)tan(γ)

this is

LaTeX: x_2\approx x_1+d \gamma _1x2x1+dγ1

we also have

LaTeX: \gamma _1=\gamma _2γ1=γ2

We can write this system as a matrix equation of the following form:

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & d \\
 0 & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x2γ2)=(1d01)(x1γ1)

where we have used the paraxial approximation such that

LaTeX: \sin (\gamma ) \approx  \gammasin(γ)γ

LaTeX: \tan (\gamma )\approx \sin (\gamma )\approx \gammatan(γ)sin(γ)γ

and

LaTeX: \cos (\gamma )\approx 1cos(γ)1

In the paraxial approximation, this system of equations can also be written as

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 x_2' \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & d \\
 0 & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 x_1' \\
\end{array}
\right)(x2x2)=(1d01)(x1x1)

where the primed variables are the slope of the line and in the paraxial approximation LaTeX: m=\tan (\gamma )=\gammam=tan(γ)=γ. More complicated matrices can be derived. We call these matrices "ABCD" matrices because they have the form

LaTeX: \left(
\begin{array}{cc}
 A & B \\
 C & D \\
\end{array}
\right)(ABCD)

We see from the above that the most fundamental transmission matrix is that of free space propagation.

Ray Transfer Matrix: Curved Dielectric Interface

he next element that we wish to investigate is the curved dielectric interface:

Curved Dielectric Interface

We first note that the effect of the curved dielectric interface is to redirect the ray and not shift it. This means that we are investigating the effect of the interface at the interface and nowhere else. From this information we deduce that LaTeX: x_2=x_1x2=x1. From the figure we can write Snell's law in the following form.

LaTeX: n_1\sin \left(\theta _1\right)=n_2\sin \left(\theta _2\right)n1sin(θ1)=n2sin(θ2)

and in the paraxial approximation we have

LaTeX: n_1\theta _1=n_2\theta _2n1θ1=n2θ2

solving for LaTeX: \theta _1θ1 we have

LaTeX: \theta _1=\gamma _1+\varphiθ1=γ1+φ

and LaTeX: \theta _2θ2

LaTeX: \theta _2=\varphi +\gamma _2θ2=φ+γ2

in the paraxial approximation we can write LaTeX: \varphi =\left.x_1\right/Rφ=x1/R, therefore

LaTeX: \theta _2=\frac{n_1}{n_2}\left(\gamma _1+\frac{x_1}{R}\right)θ2=n1n2(γ1+x1R)

which is also equal to

LaTeX: \theta _2=\frac{n_1}{n_2}\left(\gamma _1+\frac{x_1}{R}\right)=\varphi -\gamma _2=\frac{x_1}{R}+\gamma _2θ2=n1n2(γ1+x1R)=φγ2=x1R+γ2

finally we have

LaTeX: \gamma _2=\frac{n_1}{n_2}\left(\gamma _1+\frac{x_1}{R}\right)-\frac{x_1}{R}=\frac{n_1}{n_2}\gamma _1+\left(\frac{n_1}{n_2}-1\right)\frac{x_1}{R}=\frac{n_1}{n_2}\gamma
_1+\left(\frac{n_1-n_2}{n_2 R}\right)x_1γ2=n1n2(γ1+x1R)x1R=n1n2γ1+(n1n21)x1R=n1n2γ1+(n1n2n2R)x1

In matrix form, this system becomes

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{n_1-n_2}{n_2 R} & \frac{n_1}{n_2} \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x2γ2)=(10n1n2n2Rn1n2)(x1γ1)

If we now consider the case where LaTeX: R\to \inftyR, we recover the matrix

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 0 & \frac{n_1}{n_2} \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x2γ2)=(100n1n2)(x1γ1)

which yields LaTeX: \gamma _2=\frac{n_1}{n_2}\gamma _1γ2=n1n2γ1, this is of course Snell's law again and the transmission matrix for this case describes propagation of a ray through a tilted interface.

Ray Transfer Matrix: Thin Lens

We now examine one of the most important systems in optics - the thin lens:

Thin Lens Diagram

We demonstrate the power of the transmission matrix approach by simply stating the full transmission matrix of the thin lens system as the matrix multiplication of simpler transmission matrices derived above:

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{n_1-n_2}{n_2 R_1} & \frac{n_1}{n_2} \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x2γ2)=(10n1n2n2R1n1n2)(x1γ1)

This multiplication gets us 'into' the lens (note we have positive radii of curvature for rays traveling in the LaTeX: +\hat{z}+ˆz direction incident on a curved surface with 'center' to the right of the interface and negative radii of curvature for rays traveling in the LaTeX: +\hat{z}+ˆzdirection incident on a curved surface with 'center' to the left of the interface). In this case we have LaTeX: n_1\approx 1n11 and n2=n i.e.,

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{1-n}{n \left| R_1\right| } & \frac{1}{n} \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x2γ2)=(101nn|R1|1n)(x1γ1)

To propagate 'out' of the lens we multiply by another transmission matrix for a curved dielectric interface

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{n_1-n_2}{n_2 R_2} & \frac{n_1}{n_2} \\
\end{array}
\right)\left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)(x3γ3)=(10n1n2n2R2n1n2)(x2γ2)

however, in this case n2=1 and n1=n, and by convention R2<0 leaving

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 -\frac{n-1}{\left|R_2\right|} & n \\
\end{array}
\right)\left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)(x3γ3)=(10n1|R2|n)(x2γ2)

and inserting for LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)(x2γ2), we have

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{1-n}{\left|R_2\right|} & n \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{1-n}{n \left|R_1\right|} & \frac{1}{n} \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x3γ3)=(101n|R2|n)(101nn|R1|1n)(x1γ1)

and finally, multiplying this out

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 (1-n)\left(\frac{1}{\left|R_1\right|}+\frac{1}{\left|R_2\right|}\right) & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x3γ3)=(10(1n)(1|R1|+1|R2|)1)(x1γ1)

If we write this matrix as,

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 C & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x3γ3)=(10C1)(x1γ1),           LaTeX: C\equiv (1-n)\left(\frac{1}{R_1}+\frac{1}{R_2}\right)C(1n)(1R1+1R2)

considering a collimated input ray (parallel to the central axis) and propagate the output a distance 'd' we can write

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & d \\
 0 & 1 \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & 0 \\
 C & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 0 \\
\end{array}
\right)(x3γ3)=(1d01)(10C1)(x10)

Multiplying this matrix out we get

LaTeX: \left(
\begin{array}{c}
 x_3 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1+d C & d \\
 C & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 0 \\
\end{array}
\right)(x3γ3)=(1+dCdC1)(x10)

We now investigate the case where all the rays 'cross' the z-axis at the point z=d, which allows us to write

LaTeX: \left(
\begin{array}{c}
 0 \\
 \gamma _3 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1+d C & d \\
 C & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 0 \\
\end{array}
\right)(0γ3)=(1+dCdC1)(x10)

multiplying this system out we get

LaTeX: (1+d C)x_1=0(1+dC)x1=0 and  LaTeX: \gamma _3=C x_1γ3=Cx1

The first equation gives

LaTeX: 1=-d C1=dC, inserting  LaTeX: C\equiv (1-n)\left(\frac{1}{R_2}+\frac{1}{R_1}\right)C(1n)(1R2+1R1)

leaving

LaTeX: \frac{1}{d}=-C=(n-1)\left(\frac{1}{R_2}+\frac{1}{R_1}\right)1d=C=(n1)(1R2+1R1)

We note, that the geometrical location of the intersection of all rays exiting the lens is called the focal length of that lens i.e.,

LaTeX: \frac{1}{f}=(n-1)\left(\frac{1}{R_2}+\frac{1}{R_1}\right)1f=(n1)(1R2+1R1)

this is the same equation we derived earlier. This means that the transmission matrix for a thin lens is written

LaTeX: \overleftrightarrow{\mathbb{T}}_{\text{Lens}}=\left(
\begin{array}{cc}
 1 & 0 \\
 (1-n)\left(\frac{1}{R_2}+\frac{1}{R_1}\right) & 1 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 -\frac{1}{f} & 1 \\
\end{array}
\right)TLens=(10(1n)(1R2+1R1)1)=(101f1)

Ray Transfer Matrix: Curved Mirror

We next consider the 'transmission' matrix for a curved mirror

Curved Mirror Diagram

The incident angle LaTeX: \theta _1=\gamma _1+\varphiθ1=γ1+φ and the reflected angle is LaTeX: \theta _2=\pi /2-\left(\gamma _2-\{\pi /2-\varphi \}\right)=\pi -\left(\gamma _2+\varphi \right)θ2=π/2(γ2{π/2φ})=π(γ2+φ)Because LaTeX: \theta _1=\theta _2θ1=θ2, we have

LaTeX: \gamma _1+\varphi =\pi -\left(\gamma _2+\varphi \right)γ1+φ=π(γ2+φ)

and solving for γ2 we get

LaTeX: \gamma _2=\pi -\left(\gamma _1+2\varphi \right)γ2=π(γ1+2φ)

This seems a bit scrambled in a way, but if we think about reflections 'mirroring' the system along the z-axis, then LaTeX: \gamma _2\to \pi -\gamma _2γ2πγ2 i.e. measuring output angles as positive clockwise from the z-axis:

LaTeX: \gamma _2=\pi -\left[\pi -\left(\gamma _1+2\varphi \right)\right]=\gamma _1+2\varphiγ2=π[π(γ1+2φ)]=γ1+2φ

or

LaTeX: \gamma _2=\gamma _1+\frac{2}{R}x_1γ2=γ1+2Rx1

This can then be written in a matrix formalism as

LaTeX: \left(
\begin{array}{c}
 x_2 \\
 \gamma _2 \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & 0 \\
 2/R & 1 \\
\end{array}
\right)\left(
\begin{array}{c}
 x_1 \\
 \gamma _1 \\
\end{array}
\right)(x2γ2)=(102/R1)(x1γ1)

If we had simply written γ2 as measured to be positive clockwise from the z-axis for reflections, we would have arrived at:

LaTeX: \theta _2=\theta _1=\gamma _1+\varphi =\gamma _2-\varphiθ2=θ1=γ1+φ=γ2φ

and we would have derived at LaTeX: \gamma _2=\gamma _1+2\varphiγ2=γ1+2φ immediately! We can compare this result with that of a thin lens to identify

LaTeX: -\frac{1}{f}=\frac{2}{R}1f=2R

or

LaTeX: f=-R/2f=R/2, for a diverging mirror.

Ray Transfer Matrix: Thin Window

Finally, let's look at the case where we propagate through a thin window of index n. This system can be written as a product of three matrices that take into account the change in angle at both interfaces and a free space propagator

LaTeX: \mathbb{T}_w=\left(
\begin{array}{cc}
 1 & 0 \\
 0 & \frac{n_1}{n_2} \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & t \\
 0 & 1 \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & 0 \\
 0 & \frac{n_1}{n_2} \\
\end{array}
\right)Tw=(100n1n2)(1t01)(100n1n2)

filling in the values for the refractive indices

LaTeX: \mathbb{T}_w=\left(
\begin{array}{cc}
 1 & 0 \\
 0 & n \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & t \\
 0 & 1 \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & 0 \\
 0 & \frac{1}{n} \\
\end{array}
\right)Tw=(100n)(1t01)(1001n)

now writing this out, we get

LaTeX: \mathbb{T}_w=\left(
\begin{array}{cc}
 1 & 0 \\
 0 & n \\
\end{array}
\right)\left(
\begin{array}{cc}
 1 & t/n \\
 0 & 1/n \\
\end{array}
\right)=\left(
\begin{array}{cc}
 1 & t/n \\
 0 & 1 \\
\end{array}
\right)Tw=(100n)(1t/n01/n)=(1t/n01)

all-in-all then

LaTeX: \mathbb{T}_w=\left(
\begin{array}{cc}
 1 & t/n \\
 0 & 1 \\
\end{array}
\right)Tw=(1t/n01)

note that this is consistent with the small angle approximation as the actual distance propagated in the material is

LaTeX: \cos \left(\gamma _2\right)=\frac{t}{L}\to L=\frac{t}{\cos \left(\gamma _2\right)}cos(γ2)=tLL=tcos(γ2)

but because LaTeX: \cos \left(\gamma _2\right)\sim 1cos(γ2)1, we have

LaTeX: L=\frac{t}{\cos \left(\gamma _2\right)}\approx tL=tcos(γ2)t

Quick review of important transmission matrices:

Summary of Ray Matrices

Free-space matrix

LaTeX: \overleftrightarrow{\mathbb{T}}_{\text{fs}}=\left(
\begin{array}{cc}
 1 & d \\
 0 & 1 \\
\end{array}
\right)Tfs=(1d01)

Thin Window

LaTeX: \overleftrightarrow{\mathbb{T}}_w=\left(
\begin{array}{cc}
 1 & t/n \\
 0 & 1 \\
\end{array}
\right)Tw=(1t/n01)

Single curved dielectric interface

LaTeX: \overleftrightarrow{\mathbb{T}}_{\text{cd}}=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{n_1-n_2}{R n_2} & \frac{n_1}{n_2} \\
\end{array}
\right)Tcd=(10n1n2Rn2n1n2)

Lens

LaTeX: \overleftrightarrow{\mathbb{T}}_{\text{lens}}=\left(
\begin{array}{cc}
 1 & 0 \\
 -\frac{1}{f} & 1 \\
\end{array}
\right)Tlens=(101f1)

Curved mirror

LaTeX: \overleftrightarrow{\mathbb{T}}_{\text{mirror}}=\left(
\begin{array}{cc}
 1 & 0 \\
 \frac{2}{R} & 1 \\
\end{array}
\right)Tmirror=(102R1)

We see that (at least for all of these matrices, turns out to be generally true) that if the index on the input and output side of the 'object' are the same, the determinant of the matrix is unity i.e.,

LaTeX: \text{AD}-\text{BC}=1ADBC=1