xxxxxxxxxx
let t, dt;
//centro di gravità
let gx, gy;
//costante di gravitazione universale
let G;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
t = 0;
dt = 2;
gx = width/2;
gy= height/2;
G = 1000;
p = new Particella(width/2 - 100, height/2 - 100, 2.5, -1, 0, 0, 20);
q = new Particella(width/2 - 75, height/2 - 75, 1, -3, 0, 0, 10);
}
function draw(){
background(0);
fill(255, 0, 0);
textSize(35);
text(" Tempo: ", 10, 20, 250);
text( + t, 135, 48);
//p.bordi();
p.muovi(dt);
p.disegna();
//q.bordi();
q.muovi(dt);
q.disegna();
t += dt;
}