Sahyun's Physics Applets in HTML5

HTML 5

Adding two Sine waves, varying the phase of one.

Adding Two Sine Waves

Wave 1: Sine Wave with phase (solid blue): y = sin(x + phase)
Wave 2: Sine Wave (dashed red): y = sin(x)
Sum = Wave 1 + Wave 2 (thick black) = sin(x) + sin(x + phase)

Activity:

Adjust the phase of the sin graph using the slider.

Questions:

  1. What phase is needed to match the two sine graph? What happens with the sum of the waves?
  2. What phase is needed to make the one sine graph the inverse of the other? What happens with the sum of the waves?

The circle in the bottom right represents the phase on a unit circle.

This applet was developed by Steven Sahyun. The initial graph was created in MATLAB and the code was converted and extended to HTML5/JavaScript with assistance from OpenAI’s ChatGPT (Jan. 30, 2026).