Sine Wave
In this demo, we use three range control sliders to change the ways a sine wave is drawn on a canvas. The three parameters are:
- amplitude
- period
- and phase
Prompt
Generate a static sine wave on a grid of cartesian coordinates.
Make (0,0) be at the center of an 600x400 canvas and larger y at the top.
Add sliders for period, amplitude and phase.
Provide the label and values to the left of the sliders.
Make the sliders span the width less the leftSliderMargin of 100.
Draw and label the X and Y Axis.
Edit This MicroSim with the P5.js Editor
Result
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
Challenge
Create your own trigonometry demos by drawing the cosine and tangent functions.
Lesson Plan
Prompt
Generate a lesson plan for a 9th grade geometry class
that accompanies the following p5.js demonstration:
The users see a sine wave on the screen.
There are three range control sliders under the sine wave.
One slider changes the amplitude of the sine wave.
One slider changes the period of the sine wave.
One slider changes the phase of the sine wave.
Grade Level
9th Grade
Subject
Geometry
Duration
1-2 class periods (40-80 minutes)
Tools Needed
Computers with internet access, p5.js web editor, projector for demonstrations.
Objectives
- Understand the basic properties of sine waves (amplitude, period, phase).
- Learn how to manipulate these properties using p5.js.
- Visualize the effects of changing each property on the shape of the sine wave.
Introduction (10 minutes)
- Begin with a brief overview of sine waves and their significance in mathematics and the real world (e.g., sound waves, light waves).
- Introduce the p5.js tool and its purpose in visualizing mathematical concepts.
Demonstration (15 minutes)
- Project the p5.js sine wave demonstration on the screen.
- Explain each control slider and its corresponding property:
- Amplitude: Height of the wave peaks.
- Period: Distance between successive wave peaks.
- Phase: Horizontal shift of the entire wave.
Interactive Activity (30 minutes)
- Students will use the p5.js web editor to experiment with the sine wave.
- Tasks for students:
- Adjust the amplitude and observe changes.
- Modify the period and note the effects.
- Change the phase and discuss how the wave shifts.
- Encourage students to note their observations and any patterns they discover.
Group Discussion (10 minutes)
- Regroup and discuss the findings.
- Ask students to explain how each parameter affects the wave.
- Discuss practical applications of sine waves.
Assessment (5-15 minutes)
- Provide a short quiz or worksheet asking students to match wave diagrams with their corresponding amplitude, period, and phase settings.
Homework (optional)
- Students create their own p5.js sketch that includes a sine wave with adjustable properties.
- They should write a brief report explaining how changing each property affects the wave and include screenshots of their sketch.
Extensions (optional)
- Introduce concepts of frequency and angular velocity related to sine waves.
- Explore other trigonometric functions like cosine and tangent using p5.js.
Resources
- Access to the p5.js web editor and basic tutorials.
- Diagrams and explanations of sine waves and their properties.