xxxxxxxxxx
var loc, vel, acc, f, m, b, q;
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
loc = createVector(windowWidth/2, windowHeight/2);
vel = createVector(1, 0, 0);
acc = createVector(0, 0, 0);
b = createVector(0, 0, 1);
f = p5.Vector.cross(b, vel);
m = 2;
q = 1;
}
function draw() {
background(200);
ellipse(loc.x, loc.y, 10, 10);
loc.add(vel);
vel.add(acc);
acc.set(f.x, f.y, f.z);
acc.div(m);
f = p5.Vector.cross(b, vel);
f.mult(q);
}