I should also explain that all of my measurements in length are in astronomical units and all of the measurements in sidereal period are in years.
By 1, I guess most accurately the variable represents a single day. This is the formula that i derived to operate the entire situation:
if OT9 = 1
if (Timer() - Time) > 1000
Time = Timer()
planetnumber = 0
repeat
inc planetnumber, 1
Day(planetnumber) = Day(planetnumber) + 1
PlanetX(planetnumber) = 250 + CalRadius(planetnumber) * Sin(360 / CalTime(planetnumber) * Day(planetnumber))
PlanetY(planetnumber) = 200 + (CalRadius(planetnumber) * Cos(360 / CalTime(planetnumber) * Day(planetnumber)))
if Day(planetnumber) = CalTime(planetnumber) then Day(planetnumber) = 1
until planetnumber = 20
endif
endif
Here, OT9 represents one of the possible speeds. If OT9 = 1 then run at 1X speed (there are OT9 = 2 (X2) and OT9 = 3 (X3)). I will explain using the example of Mercury. This is the data i have on Mercury:
0.3871
0.24
47.89
0.206
7.00
2439
2439
0.06
5.43
1408
2
0
The variables read from the data file are:
Radius(1) = 0.3871 (Au)
Time(1) = 0.24 (years)
Largestradius = 0.24 (In the case of only Mercury)
The variables calculated as a result are:
CalTime(planetnumber) = Time(planetnumber) * 365.25 - (The Result is the length of the orbit in days)
CalRadius(planetnumber) = Radius(planetnumber) / Largestradius * (200 - 2 * planetsize) - (The result is the length of the planets orbit in the program)
PlanetX(planetnumber) = 250 + CalRadius(planetnumber) * Sin(360 / CalTime(planetnumber) * Day(planetnumber)) - (The X co-ordinate of Mercury)
PlanetY(planetnumber) = 200 + (CalRadius(planetnumber) * Cos(360 / CalTime(planetnumber) * Day(planetnumber))) - (The Y co-ordinate of Mercury)
My theory here is that the angle is the 360 / sidereal period(in days) then this gives you an angle. You can then have a variable to represent the days, which is increased by one per loop. When the variable representing days is equal to or greater than the sidereal period in days the variable resets to 0 (at which point it has completed a single orbit).
The problem is that in comparison some planets will whizz round at a certain speed while others will appear to not move. I am also getting a very strange problem where Pluto goes round incredibly fast while Mercury crawls round. Kepler's law of planetary motion alone proves that this is not the case...
These are the results churned out by my debug. They are the variables in this order:
CalRadius(planetnumber)
CalTime(planetnumber)
PlanetX(planetnumber)
PlanetY(planetnumber)
1.90216326714
87.6599960327
250
201.902160645
3.55420970917
226.455001831
250
203.554214478
4.91388034821
365.25
250
204.913879395
7.48875427246
686.66998291
250
207.488754272
25.5669212341
4331.86474609
250
225.566925049
46.8735046387
10760.2646484
250
246.873504639
94.2973709106
30684.6523438
250
294.297363281
147.711242676
60189.546875
250
347.711242676
194
90779.234375
250
394
NB: These values are from Mercury to Pluto.
EDIT - Speed issue resolved. I was dividing by 360, rather then the reverse.
.CALIBRE - COMING MAY 2010