N-Body Problem
✓ Published0🌍 Public
Mmbostock
Last edited Feb 20, 2016
Created on Feb 20, 2016
Two hundred colored circles gravitate and collide, their motion traced by white velocity streaks, in an N-body simulation rendered on an HTML5 Canvas. The piece uses the D3 v3 APIs `d3.layout.force` for the force-directed layout, `d3.geom.quadtree` for efficient collision detection, and `d3.scale.linear` to map speed to a steelblue-to-brown stroke. Each tick pauses the simulation, redraws the scene, and resumes, with circle positions and velocities updated from prior frames.
AI-generated descriptionA recreation of an earlier Protovis example.
gpl-3.0 Licensed