I'm trying to figure out the time periods in which 2 planets (2nd and 3rd in their system) are within a particular distance X from each other (say, for example, when they are 90 million kilometers or less away from each other).
I imagine there is no one or two-click way to do this, so what I've tried doing is use the Travel Calculator between the 2 planets, plugging in date after date, and jotting down the distance that pops up each time, to figure out when these planets get that close to each other, then drift apart again. (Basically, I want to figure out what the cycle for this event is).
Does this sound like it would work? I tried it a bit yesterday and I got a bit confused. Sometimes the planets at date A look far closer to each other in the orbit view than at date B, yet when I use the Travel Calculator, the distances between them are practically the same for each case. (The third planets' orbits is very eccentric, so it, so to speak, crosses the other's orbit at 2 points.)
Any suggestions or comments would be appreciated.
Comments
Thanks for the advice. I'm getting a runtime error with the script below. I tried writing the UABI for the planet I need in SelectBody, also tried putting the name of the planets in quotation marks, but no luck. Any help would be much appreciated!
sector = GetCurrentSector()
planet = sector.SelectBody()
orbit = planet.GetOrbit()
x = orbit.PositionX
y = orbit.PositionY
z= orbit.PositionZ
MsgBox ("Coordinates X, Y, Z are" & x & "-" & y & "-" & z & ".")
This will get the body selected in the system data display, and then report the orbital position for 10 days. You pass the day number into settime(), which updates the orbitals positions, which can then be grabbed with PositionX, etc. The day is the number of days past your sector's 'epoch', or starting date.