RAINBOW
A Monte Carlo Simulation of a Rainbow
Imagine a large
number of 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
& 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.
The crucial line
of code is the expression for N. By changing this
line we can simulate
rainbows in various mediums.
INPUT: ptlimit = number
of point (rays) to use in the simulation.
(If no input is specified 10,000 are used.)
OUTPUT: primary and secondary
rainbow arcs
Original
source: "Monte Carlo Computer Simulation of a Rainbow", by
Donald
Olsen, et al., The Physics Teacher, April 1990, pp. 226-227
This was
the result of an NSF summer program involving eighth and ninth
grade students.
The original program was written in Applesoft Basic.
David R. Hill,
Mathematics Dept., Temple Univ.
Philadelphia,
PA. 19122 Email: dhill001@temple.edu
=======================================================================
CONSTRUCTED for use with NSF Project
DEMOs with POSITIVE IMPACT
=======================================================================