mini changes

This commit is contained in:
root 2025-04-26 13:16:37 +00:00
parent 33aab6af5c
commit f496127bf9

View file

@ -1,5 +1,5 @@
function move_charges(charges) {
for (charge of charges) {
for (let charge of charges) {
charge.acceleration.setMag(0);
}
for (let i = 0; i < charges.length; i += 1) {
@ -23,8 +23,7 @@ function move_charges(charges) {
charges[j].acceleration.add(aj);
}
}
for (let i = 0; i < charges.length; i += 1) {
let charge = charges[i];
for (let charge of charges) {
charge.velocity = charge.velocity.add(charge.acceleration);
charge.position = charge.position.add(charge.velocity);
charge.position.normalize();