Ocean Waves Assignment

UMAP Module 741 on “Waves and Strong Tides” by L. T. King (© 1994, 1996 by COMAP, Inc., Lexington, MA) provides the background material for this assignment.

          A mathematical model of a wave is an equation of the following form:

                  h(x, t) = h0 cos(kxwt)

where

         It can be shown that in deep water, the approximate value of k is

                 

and in shallow water

                   

where D is the depth of the water in meters.  (9.8 is the acceleration due to gravity measured in m/sec2.)

         For a wave that is rotated an angle a off the x-axis, the model of the height of the wave is a function that depends on the x and z coordinates and the time t, as follows:

                  y(x, z, t) = h0 cos(k (x cosa - z sina) – wt)

         By the Principle of Superposition, when two waves f and g interact, the result is f + g.

 Projects

 1.      Develop a program that displays the axes and a wire frame of one wave as one looks down the positive z axis toward the origin.  Assume a deep-water wave moving in the positive x direction.  Have the user enter values for w, h0, and t.

                  One step at a time, revise the program so that

2.            Add shading and lights to the visualization of Project 1, illustrating ambient, diffuse, and specular lighting and showing the surface with appropriate highlights.  Have the polygons filled with color. 

3.            Add keyboard-controlled rotations to Project 2, with event-driven programming with callbacks.  Enable clipping planes parallel to each axis so that the user can slice through the sea.  Have a menu of choices of clipping plane, description of program, and help.  Use display lists to improve performance on the display.  (See Steve Cunningham's "Some Other Useful Concepts" and conicStereo.c)

4.            Revise Project 2 to animate the waves.

5.            Revise Project 4 to have two waves interact.  Have keyboard controls to allow the user to display one random wave, another, or the interaction of both waves.  Also, allow the user to designate that the second wave is identical to the first except the w values have opposite signs.  What do you observe in this case?

6.            Revise Project 5 to have three waves interact.  Have keyboard controls to allow the user to display any one, any two, or all three waves interacting.

7.            Add keyboard-controlled rotations to Project 4, with event-driven programming with callbacks.  Enable clipping planes parallel to each axis so that the user can slice through the sea.  Have a menu of choices of clipping plane, description of program, and help.  Use display lists to improve performance on the display.  (See Steve Cunningham's "Some Other Useful Concepts" and conicStereo.c)

8-14. Revise corresponding Project 1-7 assuming shallow water.