🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Gravitational acceleration calculation

Started by
143 comments, last by taby 1 year, 10 months ago

@joej && @taby , This just came out today on one of my favorite youtube channels. Thought you'd be interested.

https://www.youtube.com/watch?v=e3jGWXeBtPo

None

Advertisement

Thanks for sharing that link.

Now, do you know the formulas needed to calculate an orbit speed, so that there are circular/elliptical orbits?

2 billion years left until the milky way merges with a bunch of space crap?

We are all fucked /:O\

the interstellar distances are so great that actual collision of stars happens infrequently. We’ll be fine. Don’t quote me on that though LOL

P.S. check out Gravitas https://www.cita.utoronto.ca/~dubinski/galaxydynamics/gravitas.html

Wow, a web1 website. They still exist. Totally retro feeling :D

Ok, here is the formula:

If you want a circular orbit, you place the object r metres away and set it flying at:
v = sqrt(G*M/r) metres per second

If you want an elliptical orbit, you set it flying at a lesser speed. To calculate the desired speed based on how eccentric the orbit is:
v = sqrt((G*M/r)*(1 - e)/(1 + e))

Alternatively, if you place the object at periapsis:
v = sqrt((G*M/r)*(1 + e)/(1 - e))

LOL. At least the iPhone still decodes the good old QuickTime videos. ?

taby said:
If you want a circular orbit, you place the object r metres away and set it flying at: v = sqrt(G*M/r) metres per second

I tried this, but something is wrong: https://codepen.io/joedoej/pen/xxYPjJZ?editors=0011

You have an idea? I was not sure how to calculate M, but neither division nor addition works.

M is the mass of the Sun alone. Basically, you put the body r metres away from the Sun, and then give the planet a tangential velocity of speed v. If M = G = 1 then you should be able to set r = 1 and v = 1.

Thanks. I wanted to try those values, but then i saw i had accidently removed the clamping from Jonnys old Attract function, but not in my replacement to process pairs.
So the clamping was still active and this broke it.

Now it works: https://codepen.io/joedoej/pen/xxYPjJZ?editors=0010

This topic is closed to new replies.

Advertisement