+ 2
What is wrong with this code (JavaScript)?
Hello! I am trying to simulate a 2d solar system with gravitation pull using Newton's law. I am having trouble implementing it- atm the gravity seems to be working the opposite as I want it to and any adjustments I make seem to disable the pull. May you please help me understand how I can implement this so that bigger planets pull smaller bodies? Thank you! (Problem is line 30-40 ish I think) https://code.sololearn.com/Wa13a25A1860/?ref=app
2 Respostas
+ 1
https://code.sololearn.com/WAHqLUAab5Pc/?ref=app
I don't know why this work but I think it does, in line 40 I just changed g with -g
- 1
ghgh