You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thanks a lot for sharing the repo. There are some 挑刺 issue i found in the code:
In the code for Nbody simulation, the newton's law formula is missing the M2:
F = G * Nbody[j].w / (distancedistance);
should be replace by:
F = G * Nbody[j].w * Nbody[i].w / (distancedistance);
And since there is no boundary check, if the iteration number is large, there will be few bodies within the display area.🙈
谢谢学长!
The text was updated successfully, but these errors were encountered:
Firstly, thanks a lot for sharing the repo. There are some 挑刺 issue i found in the code:
In the code for Nbody simulation, the newton's law formula is missing the M2:
F = G * Nbody[j].w / (distancedistance);
should be replace by:
F = G * Nbody[j].w * Nbody[i].w / (distancedistance);
And since there is no boundary check, if the iteration number is large, there will be few bodies within the display area.🙈
谢谢学长!
The text was updated successfully, but these errors were encountered: