General Background: We have
been fascinated by the phenomena of a rainbow throughout time. It was Sir
Isaac Newton's experiment with light passing through a prism that revealed
a band of colors varying from red to violet. The colors of the band are
violet, indigo, blue, green, yellow, orange, and red. (A mnemonic that
is often used to recall these colors is VIBGYOR
or Richard Of York Gained Battle In Vain. An alternate form, ROY G. BIV
is also used.)
Newton concluded that white light is really
a mixture of colored lights, and that each color bends differently as it
passes through a prism. Thus we see the band of colored light which is
called the visible spectrum. The light we can see is but a portion
of the huge spectrum of energy called electromagnetic radiation.
T. Smith, Taylor County School System, Butler, Georgia, 31006
A Rainbow: A
rainbow is formed by light from the sun hitting a raindrop. When this occurs
the light is
refracted (the change of direction of light
in passing from one medium to another) into the colors of the spectrum
and then reflected
(the return of the light from striking
a surface) off the back of the raindrop. For more details see Figure 1
and the description below it.
Each color of the spectrum is refracted at
a slightly different angle depending upon it wavelength. For instance violet
light is refracted more than red light. As the spectrum of light emerges
from the drop an observer on the ground will see only one color depending
upon the angle of observation.
A light ray hits the drop from
direction SA. As the beam enters the drop it is refracted (bent) and then
strikes the back wall of the drop at B. It is reflected off the back wall
of the drop towards C. As it emerges from the drop at C it is refracted
(bent) again. (Not all rays hitting a drop undergo 'total internal reflection';
see the next figure.)
The rainbow we normally see is called the
rainbow and is produced by one internal reflection within the drop.
When conditions are just right a fainter larger secondary rainbow
with colors in reverse order appears. (See photo at the top of the page.)
This is the result of rays undergoing a second reflection within the drop.
It is possible for light to be reflected more than twice within the drop,
giving rise to higher order rainbows, but these are rarely seen. (See the
comments below and the National Geographic citation.)
Paton. Used with permission.
(Rebecca has a very nice site devoted to aspects of rainbows.)
Copyright Alana Ackerman. Used with permission
In order to develop a mathematical model
to simulate a rainbow we need further information about the angles of reflection
for the various colors of light within the visible spectrum. This requires
familiarity with the laws of reflection and refraction as well as the speed
of light in various mediums. For detailed information on these topics see
reference  and . The following paragraph is a nontechnical summary
of the information we need in order to produce an elementary simulation
of a rainbow.
The velocity of light is dependent upon
the medium through which it passes, like air or water. The change in velocity
of light as it passes from air to water cause the refraction, bending,
described above. The refraction index or index of refraction
is the ratio of the velocities of light in the two media. We can use the
refraction indices of the colored light to set up the appropriate angles
of refraction and reflection in our simulation. This information together
with algebra and trigonometry can be blended to model the color dispersion
we see in the phenomena of a rainbow. (More details can be found in the
references cited below.)
The Model: Imagine a large
number of parallel rays hitting a spherical rain drop. For each ray we
plot a single point of light in accordance with the laws of reflection
and refraction. For each ray of light we randomly choose a color that will
be seen by an observer once it has been refracted and reflected either
resulting in a point of light in the primary or secondary rainbow. Since
we are randomly assigning a color from the spectrum to a ray, the process
is using a Monte Carlo simulation. In order to get the angles correct we
use the refraction index of the colored light for the mediums air and water.
This also determines the placement of the corresponding dot of light in
our picture. Figure 2 shows a result of our simulation using 15,000 rays.
this simulation we have used only the three primary colors red, green
and blue for simplicity. Even with this small number of rays the
and secondary rainbows are evident, with
of course a lot of 'scatter' within the primary arc. In Figure 3 we simulated
the rainbow using 30,000 rays. The result is a stronger definition of both
the primary and secondary arcs.
If the water droplets are sea water then the
index of refraction changes for the colors in the visible spectrum. By
altering these indices we can simulate a sea water rainbow as depicted
in Figure 4.
A simulation using the seven colors of
the rainbow was performed in a similar manner by modifying the routine
that generated Figures 3 and 4. The primary arc is shown in Figure 5 and
an enlarged portion of the arc is in Figure 6. The colored bands for the
seven colors are quite visible. The modification required more information
of the refraction indices for colored light.
The rainbow figures in this demo were generated
by MATLAB routines rainbow , rainbowsea
, and rainbowfull respectively. (Click on the
names to download these programs. To see a description of the mfile rainbow
click on mfiledescription.) These routines
are based on an Applesoft Basic program written by eighth and ninth grade
students in a summer program supported by NSF; see reference  below.
Interestingly, there is also additional information on simulating an "acid
rainbow," which may occur in the clouds of Venus. We have also developed a
JAVA applet for this demo which has the
same functionality : Rainbow.html.
(The displays of the applet may vary slightly because of the browser you use
and the screen resolution of your monitor.)
You can construct your own rainbow with a garden hose
under the right conditions. Click here
to a 'backyard' rainbow. (Photo used with the permission of Dr. Paul
There are a large number of web sites that
contain information on rainbows. Several that were helpful in creating
the descriptions above are listed in the references.  contains an java
applet related to refraction and reflection. A very nice calculus project
on rainbows is available in .
The National Geographic Magazine has an Ask Us
column. In its March 2002 edition the following item appeared.
When I see a double rainbow, the colors in the second one are reversed.
Why is that?"
strikes a raindrop, light rays go in, bounce off the back of the drop, and
come back out. When passing in and out, the rays bend -- as in a prism --
and the colors are separated so that we see the hues of the rainbow, with
red on the outer arc. A smaller number of rays reflect twice inside the
drop before they exit. The second reflection inverts the image, resulting
in a paler rainbow with red on the inner arc. Sometimes a third rainbow,
with red again on the outer rim, is visible."
 D. Olson, et al., "Monte Carlo Computer
Simulation of a Rainbow",
The Physics Teacher, April 1990,
 S. Janke, "Somewhere Within the Rainbow",
UMAP Module 724, COMAP, Inc., Lexington, MA. (This work appeared in the
Journal 13 (2), pp. 149 - 174, 1992.)
 F.J. Wicklin and P. Edelman, "Circles
of Light: The Mathematics of Rainbows", http://www.geom.umn.edu/education/calc-init/rainbow
(This work is based on the module in .)
 B.T.Lynds, "About Rainbows",
 F.K. Hwang, "Rainbow", http://www.phy.ntnu.edu.tw/java/Rainbow/rainbow.html
(A Java applet that shows refraction and
reflection of colored light. Page contains some interesting links for physics.)
 R.W. Hall and N. Higson, The Calculus
 The Rainbow Connection,