Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Newtonian Gravity

Author
Message
Game Master1330
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 10th Dec 2013 17:55
Hey,

I was thinking about how I would go about making a simulator of the solar system, and I decided that it would be possible using the Newtonian gravity equation: F = (m1m2/r^2)G and F=MA.

The problem is that this gives me acceleration toward the sun, when what I really need is angular acceleration..

Does anybody know an equation to link the two?

Thanks,
Matt

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Dec 2013 18:16
You need to give your planets a little push along the tangent of their curve around the sun. Otherwise consider Kepler's laws for circular motion: http://en.wikipedia.org/wiki/Kepler's_laws_of_planetary_motion

"everyone forgets a semi-colon sometimes." - Phaelax
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 10th Dec 2013 21:03
Zotoaster is right. You need to move the planets along the tangent of the orbit in order for it to work.

sad fact: computer mathematics, given the variations experienced each frame, will not give you stable orbits. You can "simulate" the orbits, but using actual physics won't be stable.

I have done extensive testing in this matter with my current project. I had to abandon the idea of using real physics for the solar system. Don't get me wrong, it can be done, but you will have to make "adjustments" from time to time.

The fastest code is the code never written.
Game Master1330
16
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 10th Dec 2013 21:18 Edited at: 10th Dec 2013 21:19
Don't worry guys, I figured it out.. Thanks for the help though

Quote: "Zotoaster is right. You need to move the planets along the tangent of the orbit in order for it to work.

sad fact: computer mathematics, given the variations experienced each frame, will not give you stable orbits. You can "simulate" the orbits, but using actual physics won't be stable.

I have done extensive testing in this matter with my current project. I had to abandon the idea of using real physics for the solar system. Don't get me wrong, it can be done, but you will have to make "adjustments" from time to time."


I figured out how to do it with real physics like this in case you still want to use it:



Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330

Login to post a reply

Server time is: 2024-05-23 10:14:20
Your offset time is: 2024-05-23 10:14:20