JavaScript Gravity Simulation A gravity simulation I made. function setup() { createCanvas(800, 800, $("#main")) setInterval(draw2, 5); noStroke() } let particles = [[0, 0, 0, 0, 50]]; let newParticles = [...particles]; const gravitational_constant = 2; //Randomly spawns particles on the canvas function addDust(num) { for (let i = 0; i < num; i++) { let x = [Math.random() * 400 - 200, Math.random() * 400 - 200, Math.random() * 2 - 1, Math.random() * 2 - 1, 0.1] particles.push(x) KaladinsSenseOfHumourSpren in JavaScript February 10 2