Public
Edited
Sep 4, 2023
7 forks
180 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function pdf(x, y) {
// PDF used for sampling initial positions. x and y in [0, 1], and returned value is in [0, 1].
return 1.0;

// Lots of little bumps:22
//return 0.9 + 0.1 * Math.cos(x * Math.PI * 16) * Math.sin(y * Math.PI * 16);

// Circular blob:
//var r2 = x * x + y * y;
//if (r2 > 0.2) return 0;
//return Math.exp(-r2 / Math.pow(0.3, 2));
}
Insert cell
function initialVelocity(out, x, y) {
out[0] = 0;
out[1] = 0;
return;

/*return [
0.0 * -Math.cos(x * Math.PI * 16) * Math.cos(y * Math.PI * 16),
0.0 * Math.sin(x * Math.PI * 16) * Math.sin(y * Math.PI * 16)
];*/

// Roughly circular orbit speed:
//var r = Math.sqrt(x * x + y * y);
//var speed =
// (4.5 - 3.5 * r + 0.5 * r * (1 - r)) * Math.pow(512 / gridTextureRadius, 1);
//out[0] = y * speed;
//out[1] = -x * speed;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more