Hover over the menu bar to pick a physics animation.

Light Rays in a Transparent Isoceles Prism

Introduction

This document computes and shows the light rays in a prism with variable vertex angle and index of refraction (see Sliders above Canvas 1). The prism can be tipped about an internal axis which is located at its half of its altitude. To keep it simple the prism is triangular and isosceles with its altitude vertical until tipped. We first compute a ray input angle with an exit angle that is symmetric with the input angle. This choice results in what is called the angle of minimum deviation and it also results in the internal ray being horizontal when the tip angle is zero.

Parameters of the Calculation

The prism of index of refraction `n_p` is immersed in a medium of index of refraction `n_m`. `psi` will be the propagation angle relative to the `x` axis. `theta` will be the incident angle with respect to the interface perpendicular of the ray of angle `psi`. `phi` will be the perpendicular angle with respect to the interface between `n_m` and `n_p` or between `n_p` and `n_m` again with respect to the `x` axis. We first use Snell's law to obtain what had to be the outside incident angle `a_("inc")` to achieve angle `a_("inside")`. The prism tip angle will be labeled `a_("tip")`. The prism top vertex angle will be labeled `a_v` and its half angle will then be `a_v/2`. The direction of the rays with respect to the `x` axis will be labeled `psi`. We label the height (altitude) of the prism `h`. The coordinate system origin as well as the prism's tip rotation axis will be located at the horizontal center of the prism and at its half altitude, `h/2` as shown on Canvas 3. As is standard in browsers, `y` values are measured downward from the `x` axis. This choice for increase of `y` also results in angles being measured clockwise from the `x` axis.

Calculations for Zero Tip Angle

First we need to compute `psi` for the ray incident on the left side of the prism. To do that we need to compute `theta_("outside")` in terms of `theta_("inside") We may use Snell's law to obtain what had to be the incident angle `theta_("outside")` to achieve angle `theta_("inside")`:

`sintheta_("outside")=-n_p/n_msintheta_("inside")`

If we want the exiting ray to be symmetric with the incident ray then for zero tip angle `theta_("inside")=a_v/2` and the value of `psi_("inside")=theta("inside")-a_v/2=0`. `theta_("outside")` is NOT an angle with respect to the `x` axis. Instead the angle of the ray vector incident on the left side of the prism is `psi_0=theta_("outside")+a_(v2)`. Now we need to compute a suitable vector tip position and root for the ray whose angle is `psi_0`. For zero tip angle, we have `(0,-h/2)` as the xy location of the top prism vertex The prism base vertices are at `x_b=-htan(a_v/2)` and `x_b=+htan(a_v/2)`. So, for zero tip angle, the `xy` locations of these base vertices will be at (-x_b,h) and (x_b,h) For zero tip angle we choose the front end (pointer) of the incoming ray vector to intersect the left side of the prism at (-x_b/2,0). In order to draw the ray we also need its starting location `bbr_0` which we will call its root. The `(x,y)` coordinates of the root of the ray can be computed from its length, `l_0`, and the sine and cosine of 'psi_0' as

`bbr_0=(-x_b/2-l_0cospsi_0,l_0sinpsi_0)`

Since we have both the root and the tip of the ray that is incident from the left side of the prism it is easy to draw an arrow from the root to the tip.

Calculations for Non-Zero Tip Angle

We want to show the minimum deflection of the exiting ray. Let the tip angle be `a_"tip"`. The position of the top vertex varies as

`(x_v,y_v)=(h/2sina_("tip"),-h/2cosa_("tip"))`

The incident side perpendicular goes from `theta_0=psi_0+a_v/2` to `theta_0=psi_0+a_v/2+a_("tip")` and the exit side perpendicular goes from `-a_v/2` to `a_"exit"=-a_v/2+a_("tip")` From this information we can compute the value of the ray angle `psi` inside the prism as well as the value of `psi` as it exits the prism. The change in psi is equal to the change in the angle, `theta`, relative to the surface perpendicular.

`psi'=psi+theta'-theta\ \ \ \ \(1)`

The value of `theta` for the left side of the prism is difference between `psi_0` and the perpendicular angle `a_v/2+a_("tip")`.

`theta_l=psi_0-(a_v/2+a_("tip"))`

The exiting angle `theta_l'` relative to the left surface perpendicular is

`theta_l'=sin^-1((n_m/n_p)sintheta_l)`

So using the equation 1 we obtain the following expression:

`psi_l'=psi_0+sin^-1(n_m/n_psintheta_l)-theta_l`

We now apply the same calculation to the change in `psi` at the right side of the prism. Now the incidence angle is

`theta_r=psi_l'-(-a_v/2+a_("tip"))`

Then the exiting angle relative to the right surface perpendicular is

`theta_r'=sin^-1(n_p/n_msintheta_r)`

The new value of `psi` exiting the right side of the prism is

`psi_r'=psi_l'+sin^-1(n_p/n_msintheta_r)-theta_r`

The results of the angles for the rays are stored in an array called psiA.

Computing the locations of the ray intercepts with the left and right side of the prism.

Having obtained the values of the angles `psi` before and after each interface, we now need to compute the positions of the intercepts of the rays defined by `psi` at each interface. The intercepts become the roots for the ray defined by psi. This is a general two dimensional calculation: the intersection location of two lines and the matrix result is given in the Appendix. What is needed is the slope and the `(x,y)` location of any point on each of the lines. The simplest point for either side of the prism is its top vertex.

`(x_v,y_v)=(h/2sina_("tip"),-h/2cosa_("tip"))`

The value of the slope of the left prism side is:

`m_("left")=tan(pi/2+a_v/2+a_("tilt"))`

The slope of the right side of the prism is then

`m_("right")=tan(pi/2-a_v/2+a_("tilt"))`

The slope of the ray will be called `m_r`. For the incident ray on the left side `m_r=Math.tan(psi_0)`. Then we can use the result in the appendix:

`[[y],[x]]=1/(m_1-m_2)[[-m_2(y_1-m_1x_1)+m_1(y_2-m_2x_2)],[-(y_1-m_1)x_1+y_2-m_2x_2]]\ \ \ \ \(2)`

Here we will choose `m_1=m_r` as the ray angle. For the root of the first ray we use `(x_1,y_1)=(-x_b/2-l_0cospsi_0,h/2+l_0sinpsi_0)`. For the left side `m_2=m_("left")` and the vertex coordinates are `(x_2,y_2)=(h/2sina_("tip"),-h/2cosa_("tip"))` Having computed the intersection of `psi_0` with the left side, the new ray root will be that intersection `(x,y)`. Then we use the new angle `psi` computed above to compute the new `m_r` and these will be the new values of `(x_1,y_1)` and `m_1`. For the right side we again use the top vertex position as `(x_2,y_2)` and `m_2=m_("right")` Using equation 2 again, the new values of `(x,y)` will be the root of the exiting ray and its direction has already been computed and saved as psiA[2]. To demonstrate the minimum deviation position we will make the length of the exiting ray long compared to the dimensions of the prism. The thickness of the prism causes some unwanted deviation of the final ray pointer but it is generally clear that the symmetric incident and exiting ray result in very small deviation.

Explanation of the Controls

The learner has access to sliders for varying tip angle, vertex angle, and index of refraction. When the tip angle, vertex angle, or index of refraction are increased too much:

1. For the left side of the prism, the computed ray can sometimes become parallel with the surface. This results in no solution from Snell's law because the component of the ray wave vector along the surface perpendicular 0.

2.For the right side of the prism, the ratio `(n_m/n_p)sintheta_r` can become large enough that the exiting ray is parallel to or internal to the right side.

Explanation of the Animation

When you press the Start Tipping button the prism cyclically starts tipping about its center. The exiting ray on the right arrowhead goes from the small "Nominal Minimum Deviation" circle quickly downward to its lowest point and then quickly back upward to the circle. That is the concept of minimum deviation angle. When you want to view the spectrum of a small (point) light source, the prism should be held at the minimum deviation angle.

When you press the Start Photon button, a small filled circle starts at the root of the left ray and progresses along all three rays. Of course the speed of a photon in the prism is reduced with respect to the speed in the immersing medium. So the separation of the dots in the prism is `(cdeltat)/n_p` while that in the immersing medium is `(cdeltat)/n_m` where `c` is the computer analog of the speed of light and `deltat` is the graphics frame time increment.

As always, you can see the code that I used by choosing 'More Tools | Developer Tools' from the settings on your browser.

Canvas 1: Cross Section View of Prism
Rays (Blue Arrows) Incident, through, and Exiting the Prism
Also Shows the Effect of Tipping the Prism about its Center
Note the Nominal Minimum Deviation Angle Circle and Zero Tip Exit Ray at the Right
Exiting Arrow Pauses at this Circle and Turns Around

Appendix:Intersections between lines each defined by a point `(x_i,y_i)` and a slope, m

Written in terms of the intersection point, (x,y) we have:

`y=y_1+m_1(x-x_1)`
`y=y_2+m_2(x-x_2)`

Rewriting this as a matrix times a vector (x,y) we have:

`[[1,-m_1],[1,-m_2]][[y],[x]]=[[y_1-m_1x_1],[y_2-m_2x_2]]`

The inverse of the matrix on the left is:

`M^(-1)*M=1/(m_1-m_2)[[-m_2,m_1],[-1,1]][[1,-m_1],[1,-m_2]]= 1/(m_1-m_2)[[m_1-m_2,0],[0,m_1-m_2]]=bb1`

`[[y],[x]]=1/(m_1-m_2)[[-m_2,m_1],[-1,1]][[y_1-m_1x_1],[y_2-m_2x_2]]`

`[[y],[x]]=1/(m_1-m_2)[[-m_2(y_1-m_1x_1)+m_1(y_2-m_2x_2)],[-(y_1-m_1)x_1+y_2-m_2x_2]]`