mini changes
This commit is contained in:
parent
33aab6af5c
commit
f496127bf9
1 changed files with 2 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
function move_charges(charges) {
|
function move_charges(charges) {
|
||||||
for (charge of charges) {
|
for (let charge of charges) {
|
||||||
charge.acceleration.setMag(0);
|
charge.acceleration.setMag(0);
|
||||||
}
|
}
|
||||||
for (let i = 0; i < charges.length; i += 1) {
|
for (let i = 0; i < charges.length; i += 1) {
|
||||||
|
@ -23,8 +23,7 @@ function move_charges(charges) {
|
||||||
charges[j].acceleration.add(aj);
|
charges[j].acceleration.add(aj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let i = 0; i < charges.length; i += 1) {
|
for (let charge of charges) {
|
||||||
let charge = charges[i];
|
|
||||||
charge.velocity = charge.velocity.add(charge.acceleration);
|
charge.velocity = charge.velocity.add(charge.acceleration);
|
||||||
charge.position = charge.position.add(charge.velocity);
|
charge.position = charge.position.add(charge.velocity);
|
||||||
charge.position.normalize();
|
charge.position.normalize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue