10-15-2004, 07:04 AM | #1 (permalink) |
Junkie
Location: RI
|
Figuring out coordinates in 3D Space
On an online game that I run, I'm going to try to design a simulation of actual planetary movement around a central point or star. The only problem is, I can't figure out the relationship between the central point to the planet and how it'd move.
If anyone has some ideas on what to look around for and where I should look, I would be greatly appriciative. |
10-15-2004, 07:48 AM | #2 (permalink) |
Addict
|
I would use trignometry. use the hypotenuse as the distance from the centre point to the planet. using a trig formula such as sin(angle) = opp/hyp increasing the angle between the line created by the plant and central point at the start and the same line as it moves round should create circular motion around a point
hope this makes sense |
10-15-2004, 09:24 AM | #4 (permalink) |
Junkie
Location: In the land of ice and snow.
|
http://www-istp.gsfc.nasa.gov/stargaze/Smotion.htm
This website is called "How orbital motion is calculated" I don't know if it will help, since my math and physics and programming aren't at a level where this stuff makes sense to me. |
10-15-2004, 08:50 PM | #8 (permalink) |
Junkie
|
I thought I would expand (let's see if my memory serves me right)
You are probably useing an equation for the force between 2 objects is F=g(M1)(M2)/D^2. I think that is the equation for force between 2 objects. Then you use F=MA to determine acceleration, ect. Now let's say you have 2 objects one at point (x1,y1,z1) and another at point (x2,y2,z2). Calculate the Force on each axis by doing this Fx=g(M1)(M2)/(x2-x1)^2 Fy=g(M1)(M2)/(y2-y1)^2 Fz=g(M1)(M2)/(z2-z1)^2 from there calculate acceleration one each axis followed by velocity followed by the new position. Never compile the forces/accel/velocity into the combined force (there is no reason to do it) |
10-15-2004, 09:19 PM | #9 (permalink) |
Crazy
Location: Salt Town, UT
|
Rekna, I'm probably missing something here, so just correct me if I'm wrong.
But don't you need to determine the total distance to figure out the gravitational force? I mean, if X1 and X2 are really close, but Y1,Z1 and Y2,Z2 are really far apart, the X force shouldn't be huge, should it? Because if the distance is huge, all the forces are going to be small, no matter how close some of the coordinates are. Of course, I could be totally wrong, but at first and second glance, I'm just not seeing how that would produce accurate results. |
10-15-2004, 09:26 PM | #10 (permalink) |
Crazy
Location: Salt Town, UT
|
Figuring out the distance between two points on a 3d plane is not all that difficult, the way I am thinking (which could be wrong, mind you), but it's definitely a two step process, and there is probably someone out there that has the real equasion(sp) to figure this out quickly and correctly in one step, but until that person comes around, here is my "solution":
Step 1. Ignore Z (for now), calculate the distance on just the XY plane between the two points. Now, keep the distance between the two points handy, because you will need it in the next step. Step 2. Take the distance from step 1, use it as one side of the triangle, now, take the Z difference and use that as the second side of the triangle, calculate the distance on that, and bang. All done, the distance between two three dimensional points. With that distance, you can multiply the force out, and split it into it's three vectored components (which I can't remember how to do, so it's up to you). Anyways, even if I am wrong, it was fun even thinking about it, thanks for the change up from the regular web-programming side of things (read from db, draw form, handle form, write to db) |
10-16-2004, 01:59 AM | #11 (permalink) | |
Junkie
|
Quote:
It has been a long time since I have done this but breaking up a 3d vector into components wasn't to hard. I'll see if i can find a link. |
|
10-16-2004, 10:36 AM | #12 (permalink) |
Junkie
|
http://tutorial.math.lamar.edu/AllBr...icalCoords.asp
then all you have to do is figure out theta and phi. Which is pretty trivial. |
11-05-2004, 10:10 AM | #13 (permalink) | |
Once upon a time...
|
Quote:
__________________
-- Man Alone ======= Abstainer: a weak person who yields to the temptation of denying himself a pleasure. Ambrose Bierce, The Devil's Dictionary. |
|
11-05-2004, 04:10 PM | #14 (permalink) |
Tilted
|
You say you want to create a simulation of actual planetary movement, but I think you have to first decide how accurate you want it, and for what time range. I'm going to outline some different options that vary starting from the least accurate to most accurate:
1) Assume elliptical plantary movement with constant angular velocity. Then all you need to do is plug in 1 parametric variable for time into three eqns for x, y, and z. 2) Same as above but using Kepler's law to take into account the angular velocity differences depending on the distance from barycenter. 3) Use an analytical solution such as VSOP87. This would be accurate to about an arcsecond. The VSOP87 solution doesn't give Pluto 4) Attempt "solve" an n-body problem as suggested above. I wouldn't recommend it. 5) Use an integrated solution (basically the n-body problem has already been done). DE200, DE403 are probably your best bet. This would give sub arcsecond resolution. |
Tags |
coordinates, figuring, space |
|
|