Published
Edited
Jul 18, 2019
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chladni = (x, y) => (a * Math.sin(Math.PI * n * x) * Math.sin(Math.PI * m * y) + b * Math.sin(Math.PI * m * x) * Math.sin(Math.PI * n * y))
Insert cell
Insert cell
{
c.canvas.width = c.canvas.width;
let d = c.getImageData(0, 0, c.canvas.width, c.canvas.height);
for (let i = 0; i < d.data.length; i += 4) {
d.data[i + 3] = 255;
d.data[i] =
d.data[i + 1] =
d.data[i + 2] =
chladni(((i/4) % c.canvas.width) * zoom, Math.floor(((i/4) / c.canvas.width)) * zoom) * 255;
}
c.putImageData(d, 0, 0);
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more