Skip to content

fbn776/sine-waves

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sine Waves Simulator

A visual, interactive sine wave simulator that demonstrates wave superposition by adding multiple sine waves with different amplitudes, frequencies, and phases.

Overview

This project visualizes the addition of multiple sine waves in real-time. Watch as up to 8 individual sine waves with randomized properties combine to form a resultant wave. The simulator lets you see both the final combined wave and the individual component waves that make it up.

  • Controls:
    • Waves Button: Toggle visibility of individual wave breakdown
    • Reset Button: Generate a new set of random waves
    • Show/Hide Buttons: Toggle individual wave contributions

How It Works

The simulator demonstrates the principle of wave superposition, where the resultant wave is the sum of all individual waves at each point:

y(x) = Σ Aᵢ × sin((2π × x / Tᵢ) + φᵢ)

Where:

  • Aᵢ = Amplitude of wave i
  • Tᵢ = Time period of wave i
  • φᵢ = Phase shift of wave i

About This Project

This was a fun experimental project I created to explore:

  • Mathematical wave properties
  • Canvas animation techniques
  • Real-time visualization
  • Interactive physics simulations

License

Feel free to use and modify this code for your own learning and projects!


Created as a fun learning project to explore wave physics and JavaScript canvas animations.

About

A demonstration of sine wave addition

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors