Sahyun's Physics Applets in HTML5

HTML 5

Sine, Cosine and phase.

Sine Wave (solid): y = sin(x + phase) and
Cosine Wave (dashed): y = cos(x)

Activity:

Adjust the phase of the sin graph using the slider.

Questions:

  1. What phase is needed to match the sine graph with the cos graph?
  2. What phase angle is needed to make the sin graph the inverse of the cos graph?
  3. If you were to add a phase for the cos graph, what phase angle would be needed to match the sin graph when the sin graph's phase angle is 0?

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).