Trigonometry help on planetary movement

I’m going to be running an RPG set in space, and I need to come up with a simplified way to determine the distance between two planets in the system. Been a while since I did any trig, so I’m trying to create a handy chart that I can consult. Here’s what I have so far:

Since it is a small star, the orbital distances are comparatively smaller than that of Earth.

Planet 1 is at a distance of 21 million miles, planet 2 at a distance of 29 million miles. (I realize that metric is sexier for science but all the unit measurements in GURPS are imperial.)

Planet 1 orbits in 58.8 Earth days, planet 2 orbits in 97.41. I looked at that and said, hey! The ratio is about 60:100. Or to look at it like a clock, every Earth day that passes, planet 1 moves 1 minute, and planet 2 moves 36 seconds.

Now I just need a way to calculate their distance from the number of “minutes” apart they are. I grok that the number of “minutes” * 6 = degrees, and that degrees * pi/180 = radians.

I also grok that at 0 minutes/0 degrees (their closest separation), the distance is distance2 - distance1, and that at 30 minutes/180 degrees (their farthest separation, as the spacecrow flies), the distance is distance2 + distance1. At 15 minutes/90 degrees apart, the Pythagorean theorem will suffice (since the orbital distances form the legs of a right triangle and I can solve for the hypotenuse).

It’s all them other distances between that get me. How do I figure 'em?

I started putting together a chart of distances in Excel using the formula for the law of cosines: c[sup]2[/sup] = a[sup]2[/sup] + b[sup]2[/sup] -2ab*cos(angle).

It seems to be giving accurate answers for angles below 90 degrees, except that for some reason the distance is greater at 66 degrees than it is at 90 degrees. Is that right?

For degrees over 90, the answers are clearly wrong.

How did I goof?

I can’t do trig. May I offer an alternate, “poor man’s” version?

If I were to GM a game, I would use a hexagon based map of the planetary system, and decide on a scale. (Say, 1 hex equals 1 light minute.) (I have hex maps left over from my strategy boardgame heyday. :wink: )

Decide on an orbital period for each planet or asteroid, and their “start” positions (when the players first enter the system, for example). You should be able to figure out how long it takes for each planet to move one hex along it’s orbital track. (Example: Place the planet at 9 hexes out from the star, you can then count how many hexes are in the orbital ring. Divide number of hexes by the planetary year, and voila!)

When you need to know how far planet 3 is from planet 4, figure out which hexes they should be in at that moment, and count the distance, in hexes.

That works for circular orbits, not so well with irregular ones.

I did this for a Traveler RPG game.

I realise it ignores gravitational effects, but the sci-fi engines were so powerful that trips lasted only a few days, usually, so that minor course corrections due to the gravitational effects of the star(s) and planets were merely a footnote as far as the plot goes.

Are you sure you chose the correct denominations for the sides? If you letter the planets A and B and the sun they’re orbiting C, then the side whose length you’re looking for is a. The angle between the two planets is the angle at C, as it appears in the equation you’re quoting (the sides are named for the points of which they are opposite). Working on that equation, we get

a = sq root [c² - b² + 2ab*cos(angle at C)],

which should work just fine.

I don’t follow you. C is the sun; A is planet 1; B is planet 2.

AC is planet 1’s orbital distance, also called side b; BC is planet 2’s orbital distance, also called side a. I’m trying to solve for AB.

Angle C should be the degrees difference between A and B, and side c should be opposite angle C, right? I should be solving for c, not a. I think.


Sorry, my fault (I labelled the points differently on my scrap paper than in that thread :smack:). You’re right, if we label the sun C, then the side you’re looking for is c and the angle at the sun is the one that goes into the cosine in your equation.

Then again, you must have goofed up your calculation when you said you got a bigger distance for an angle of 90° than for 66°. The cosine of 90° is zero, so the -2ab*cos part becomes zero as well, and we have c² = a² + b² (Pythagoras would agree with that). The cosine of 66° is something like .4067, in any case larger than zero, which means that your result ought to be lower.

The law of cosines also applies to obtuse triangles, so I don’t see why your results for angles > 90° can be wrong.

Musta goofed up the equation.


G1 is orbital distance 1
G2 is orbital distance 2
D1-31 are the degrees difference for the values 0-30 minutes, multiplied by 6.

Jesus, Fish, there have only been something like 22 RPGs created in the history of the US space program. You’re working on number 23, and you are farting around in Excel? Come on, what are you really up to?!

If you’re asking me, “is this a homework question?” the answer is no. I’m doing this for the alleged fun of it. :slight_smile:

I’m trying to figure out a nice shorthand chart for each planetary distance from 0 degrees to 180 (because they’ll never be farther apart than that).

Unfortunately, I can’t get the formula for the law of cosines to give me realistic answers, and I’m not sure where I goofed up.

You did remember to convert degrees into radians, right? Excel expects the argument of cosine to be in radians.

You did remember to convert degrees into radians, right? Excel expects the argument of cosine to be in radians.

I just figured that part out, actually.

I started with a known value (180 degrees) and worked backwards until I realized that the answer was 3.14159. Then I slapped my forehead and checked the input parameters for the COS() function. Yeah, it should be in radians.

Now it works just fine. :slight_smile:

Thanks for the help!

Just in case you grow tired of working this out manually (or don’t want to write a script for it), here’s a web engine that lets you enter parameter for any triangle and computes the remaining values (providing that the known parameters are sufficient for this calculation, of course). The page is in German, but that shouldn’t keep you from using the engine.

I’m not clear on why you are trying to do this; if what you want is an accurate way to estimate the travel time between planets then you are also going to have to account for the differences in orbital velocity. (I’m assuming that your ships don’t have drives that can accelerate at multiple Gs or some other beyond-hard-science tech that would let you dispense with the issue entirely.) If what you want in an explicit answer, numerically integrating (i.e. adding up time steps) using Kepler’s second law will get you very, very close, and you can also figure out speed (though you’ll still have to figure out the vector for actual velocity). However, for game purposes, I think mlees’ solution is good enough for done; who wants to sit there doing orbital mechanics calculations every time your characters decide to fly from Planet F to Planet R? (I do, actually, but I’d set up the problem in Matlab or Mathematica and have it generate answers automatically, requiring a lot more math than you probably care for.)


This link for 3-D starmaps might be your best bet to see if anyone else has done the work for you already.

It’s also a way of estimating information data lag between planets, as from an interplanetary information network; it’s also a way of calculating range for other things (for instance, a transporter) that have a maximum finite operational distance.

Yes, I would have to account for the vector of planetary movement involved, but having a round figure to start with is good enough for going on.