I have an orbit sim but my math is off by a bit… idk where or why so I need help.
Also, no problem!
Ya my math is off by a lot…
Wow I can’t do math that good!!!
Can you type the original equation / expression? There are a few letters I can’t read out. (You can use x^2 for x squared) btw you can also tag @CodeHelp
Ok ya I’ll find the original equation just give me a bit
To calculate gravitational force, you can use this formula:
To simplify this, you can break it into X and Y velocity (you could also replace ”𝒎1𝒎2” with another value)
That’s basically all you need.
Link to the project:
I have no idea how to help, really. But I am pretty sure COAN knows this kind of stuff, and if he can’t help you for some reason, try to ask @ThinBuffalo.
@Awesome_E, this is the equation I’m using for both x and y
Distance should be distance^2
And what r u solving for?
The code is actually working, but there are a couple of things you may want to change.
First of all, you could cut down a lot on the amount of variables.
Second, you should give the planet an initial velocity, otherwise it will shoot straight for the sun with that slingshot effect.