This commit is contained in:
Crizomb 2023-02-15 13:34:49 +01:00 committed by GitHub
parent ced1874e6c
commit 70a6259d8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,6 +107,7 @@ class Node:
else:
self.create_children()
self.center_of_mass = (self.center_of_mass * self.mass + star.pos * star.mass) / (self.mass + star.mass)
self.mass += star.mass
self.children[self.get_child_index(star.pos)].insert(star)