Skip to content

Commit 5718530

Browse files
committedSep 23, 2017
Rename local var.
1 parent 6cadb82 commit 5718530

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/manyBody.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ export default function() {
2626
}
2727

2828
function accumulate(quad) {
29-
var strength = 0, q, c, sumC = 0, x, y, i;
29+
var strength = 0, q, c, weight = 0, x, y, i;
3030

3131
// For internal nodes, accumulate forces from child quadrants.
3232
if (quad.length) {
3333
for (x = y = i = 0; i < 4; ++i) {
3434
if ((q = quad[i]) && (c = Math.abs(q.value))) {
35-
strength += q.value, sumC += c, x += c * q.x, y += c * q.y;
35+
strength += q.value, weight += c, x += c * q.x, y += c * q.y;
3636
}
3737
}
38-
quad.x = x / sumC;
39-
quad.y = y / sumC;
38+
quad.x = x / weight;
39+
quad.y = y / weight;
4040
}
4141

4242
// For leaf nodes, accumulate forces from coincident quadrants.

0 commit comments

Comments
 (0)
Please sign in to comment.