MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 16 Jul 2013 02:11 PM |
I want to take a part and have it orbit around another part - with all the factors of the three laws Kepler had created.
Unfortunately, my Physics year for astro-physics doesn't hit until the next season. I am wondering if anyone here has gone through enough in this field - or just happens to know how it works - to give me an accurate answer.
The farthest, and only accurate equation I have gotten to, is simply using Newton's laws to find the force of attraction between two bodies.
local g = 196.2 local F = g((p1:GetMass() * p2:GetMass())/((p2.Position-p1.Position).magnitude)^2)) |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 16 Jul 2013 02:21 PM |
| Kepler's laws describe the geometry of gravity based on Newton's laws. They describe how the planets move, not why. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2013 02:34 PM |
You'll need to "create" an orbit, at the moment, if you apply your force in any way, those two bodies will merely move towards each other. You need to apply Keplers Law, as you've stated above.
But, it depends how indepth you're going with this,if you want a true gravity simulator, you need to include things like foci for elliptical orbits.
|
|
|
| Report Abuse |
|
|
|
| 16 Jul 2013 02:37 PM |
| @1waffle1, Presumably he is going to include Newtons laws of Gravity and motion into his equations anyway? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 16 Jul 2013 03:38 PM |
Using an alogirthm specifically designed to describe an orbit will likely work only for a single gravitational body and wont likely cooperate with other gameplay features too well.
So go with the force approach.
Then the only problem is the stability of the orbit. If you were making your own physics you would have to worry about properly integrating the force/velocity/position stuff, but roblox probably does something like that so if you use BodyForce or something, it might be stable enough already. |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 16 Jul 2013 03:41 PM |
| BodyForce would be the least stable of all options. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2013 03:43 PM |
I dont think BodyPosition would work, and i dont see any other options either for more complex systems.
If theres only a single gravitational body you can use your fancy orbit formulas to get a 100% stable orbit. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 16 Jul 2013 04:50 PM |
"Kepler's laws describe the geometry of gravity based on Newton's laws. They describe how the planets move, not why."
You're always so helpful. And smart. Smart as can be.
Anyways, none of this is too helpful in being able to use his equations to duplicate one body orbiting another based on things such as velocity, gravity (which both are obtained from another string of equations based on mass and distance), mass, and distance (though distance would correlate to velocity).
So thanks for all your attempts, but it would have been easier to say "I don't understand Kepler's laws enough to do this" |
|
|
| Report Abuse |
|
|
Charl3s7
|
  |
| Joined: 07 Dec 2007 |
| Total Posts: 4146 |
|
|
| 16 Jul 2013 05:24 PM |
| I thought the gravitational constant (G) was 6.67384e-11 |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 16 Jul 2013 05:40 PM |
"I thought the gravitational constant (G) was 6.67384e-11"
Not in ROBLOX. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
| |
|
Charl3s7
|
  |
| Joined: 07 Dec 2007 |
| Total Posts: 4146 |
|
|
| 16 Jul 2013 05:41 PM |
| idk. I remember learning about this stuff in my physics class I took, but I never applied it to roblox. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 16 Jul 2013 05:43 PM |
^^^
Physics is my major, but it's too bad I haven't touched planetary things yet. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 16 Jul 2013 06:09 PM |
^^^
The reason I'm using the laws is because I'm making a solar-system sandbox game where you can in real time edit the elliptical orbits of planets or have the planets collide with things such as the sun or something. I want people to be able to edit say, the velocity, to have the planet slow down and slowly (from the KL equations) start to spiral into the sun because of lack of speed. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 16 Jul 2013 06:42 PM |
Kepler's laws are more geometry than they are physics. If your intention is to understand the math rather than apply it practically, the equation to find the position of the planet relative to the star as a function of time can be calculated by:
perihelion = closest point on the ellipse to the star center = center of the ellipse time = time since the planet was at the perihelion
major=|center*perihelion| -- semi-major axis eccentricity=|center*position of the star|/major
E=sin(E)*eccentricity + sqrt(gravitational_constant(mass_of_star+mass_of_planet)/major^3)*time -- eccentric anomaly
angle = 2*atan(sqrt((eccentricity+1)/(eccentricity-1))*tan(E/2)) radius=major*(1-eccentricity^2)/(1+eccentricity*cos(angle)) |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 16 Jul 2013 09:06 PM |
There is a fair amount of information on orbital(kepler) elements which are a system used to uniquely define a orbit - you can also convert them directly back to state vectors to use in your bodyforce though i think just adding the state vectors to it's current cframe would be more stable.
I got most of the way through the conversion between elements and vectors before moving on to other projects - it takes a fair bit of messing but you will get there.
Ill try and finish it off in the next day or so - if you still need a hand then just let me know, |
|
|
| Report Abuse |
|
|
shadow350
|
  |
| Joined: 17 Aug 2009 |
| Total Posts: 38153 |
|
|
| 16 Jul 2013 11:34 PM |
ogm nerds
~Oh boy, here we go again~ |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2013 03:50 AM |
| Just calculate the force exerted by the gravitational bodies. Use bodyforce to apply it to take advantage of robloxs force integration and stoof. |
|
|
| Report Abuse |
|
|
a1u1
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 452 |
|
|
| 17 Jul 2013 03:13 PM |
@Oysi that thing where it's like m1 reminds me about Albert's Theory Of Relativity. It's cool, and a bit catchy. It's simply e = mc2. BUT THAT'S NOT FULL! ALBERT SHOULD WORK MORE (but he died)! BUT HERE: http://www.youtube.com/watch?v=NnMIhxWRGNw
That's proof e=mc2 isn't full O_O (above is the proof, the youtube link) |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2013 10:01 PM |
| I am sorry if I am derailing this thread, but why did MNN ragequit from MS? |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 18 Jul 2013 10:25 AM |
| the members were no longer a fan of having a dictator and he recognized that. |
|
|
| Report Abuse |
|
|