/chladni

Sand on a speaker cone - a physics demonstration in p5js.

Primary LanguageJavaScriptMIT LicenseMIT

A small physics demonstration using p5.js.

Chladni patterns form when a speaker playing a set frequency is placed underneath a square plate covered with sand. You can see an example here.

Screenshot

I used the derivation here for a closed-form solution to the wave equation. The derivation makes some simplifications, including setting the boundary conditions of the plate to 0 (when they'd actually be vibrating freely and described by some complex PDEs outlined on that page). For the sake of writing this code in a single evening, I chose not to delve much deeper.