xxxxxxxxxx
32
const c = 30;
const G = 2;
const dt = 0.05;
let m87;
const particles = [];
let start, end;
function setup() {
createCanvas(windowWidth, windowHeight);
ellipseMode(RADIUS);
m87 = new BlackHole(width / 2, height / 2, 3000);
start = height / 2;
end = height / 2 - m87.rs * 2.6;
for (let y = 0; y < start; y += 5) {
particles.push(new Photon(width - 20, y));
}
}
function draw() {
background(255);
for (let p of particles) {
const force = m87.pull(p);
p.update();
p.show();
}
m87.show();
}