@joej && @taby , This just came out today on one of my favorite youtube channels. Thought you'd be interested.
Gravitational acceleration calculation
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
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))
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