Aurora 4x
VB6 Aurora => VB6 Mechanics => Topic started by: Kyle on September 06, 2018, 08:06:41 PM
-
Hi, hoping Steve can answer this, I don't see that it's been answered anywhere.
What's the formula for how far a comet travels in a given time period?
When it's < 1 AU from the sun, it's a nice constant speed.
But farther out, comets tend to move slower and slower the farther away they get, and it's not clear exactly how the distance is determined.
Thanks!!
-
Knowing Steve, it's probably the actual formulae for meteors/comets (Start here: http://mathscinotes.com/2011/07/speed-of-a-meteor/ (http://mathscinotes.com/2011/07/speed-of-a-meteor/)) modified ever-so-slightly for Aurora's 360-day year.
-
Here is the code for C#
double AUTime = 0;
double OrbitTime = Math.Pow(Math.Pow(Comet.OrbitalDistance / 2, 3) / Comet.ParentStar.StarType.Mass, 0.5); // result in years
if (Comet.CurrentDistance > 1)
{
double CloserOrbitTime = Math.Pow(Math.Pow((Comet.CurrentDistance - 1) / 2, 3) / Comet.ParentStar.StarType.Mass, 0.5); // result in years
// time to move 1 AU at this distance in seconds
AUTime = ((OrbitTime - CloserOrbitTime) / 2) * (double) GlobalValues.SECONDSPERYEAR;
}
else
AUTime = 0.18 * (double) GlobalValues.SECONDSPERYEAR; // comet moves about 5.5 AU per year
double AUMoved = Timescale / AUTime;
-
AWESOME!
-
Would it make more sense for Comet.OrbitalDistance to be Comet.CurrentDistance in line 2?