eigendrum
Eigendrum is an interactive web application that allows users to draw arbitrary shapes and hear them as real drumheads, dynamically calculating their vibrational modes. It beautifully translates advanced physics and numerical methods like finite element analysis into an accessible, audible experience. This project captivates HN by offering a tangible exploration of complex mathematical concepts, including Mark Kac's famous "Can one hear the shape of a drum?" problem, all running client-side.
The Lowdown
Eigendrum is an innovative web application that brings complex physics to life, allowing users to draw any 2D shape and instantly hear it resonate as a drum. Developed by Basel Ashraf, this tool visually and audibly demonstrates how the geometry of a drumhead dictates its unique vibrational frequencies and modes, all computed in real-time within the browser.
- Physical Basis: The core principle is that a drumhead clamped at its rim vibrates in specific shapes and frequencies, which are solutions to an eigenvalue problem (−∇²u = λμ).
- Numerical Computation: Since analytical solutions are rare for arbitrary shapes, Eigendrum employs finite element analysis, meshing the user's drawn shape with triangles to numerically solve for the smallest eigenvalues and corresponding modes.
- Accuracy & Validation: The solver's reliability is ensured by testing against shapes with known analytical solutions (like circles and rectangles), consistently reproducing frequencies to high precision and providing guaranteed slight overestimates.
- Mallet Interaction: The simulation accounts for where a drum is struck; striking a spot excites each mode proportionally to its movement at that point, demonstrating that a strike is a mixture of all modes. Users can also isolate and play individual modes.
- Parametric Shapes: Beyond drawing, users can define drum shapes using mathematical equations (e.g., r(t) or x(t), y(t) pairs) to create precise or complex geometries, allowing for systematic variation and exploration of forms like superellipses or nephroids.
- "Isospectral Drums" Demo: The tool directly addresses Mark Kac's 1966 question, "Can one hear the shape of a drum?", by demonstrating "Kac drum I and II"—two distinct shapes that produce identical sounds, proving that the answer is "no."
- Modeling Details: Essential physical parameters like absolute pitch (scaled by area), damping (Rayleigh damping, causing high overtones to fade first), and mallet characteristics (width, contact time) are modeled, allowing for a realistic acoustic experience.
- Client-Side Execution: Eigendrum is implemented entirely client-side, with the mesh generation, eigenvalue solver, and audio synthesis all running in the user's browser, requiring no backend or build steps.
- Open Source & Privacy: The project's source code, including the solver and tests, is publicly available on GitHub. User-drawn shapes are stored in the URL hash, not sent to servers, respecting privacy.
Eigendrum stands out as a sophisticated yet accessible application that demystifies complex wave mechanics through interactive experimentation. It's a testament to the power of numerical methods and client-side web technology, offering both an educational tool for exploring acoustics and a fascinating answer to a celebrated mathematical puzzle.