REM Planetary type Ellipses, RG Weston, 27.12.2002 MODE8 PRINTTAB(4,0)"Press a key to get next elliptical planetary orbit, or hold down for many" delay=INKEY(100) GCOL0,1 ORIGIN 640,512 REPEAT n=n+1 col=n MOD 16 IF col=0 THEN col=1 IF col=8 THEN col=9 GCOL0,col T=RND(360) :REM angle of ellipse axis to the x axis a=20+RND(250):REM semimajor axis e=RND(999)/1000 :REM eccentricity PROCellipse(a,e,T) UNTIL 0 END : DEF PROCellipse(a,e,T) PLOT69,0,0 b=a*SQR(1-(e^2)) COLOUR col PRINTTAB(4,2) "Semi-major axis = ";a;" Eccentricity= ";e,"Angle= ";T;" deg";SPC(3) FOR t=1 TO 360 REM ellipse centred on origin x= a*COSRADt y=b*SINRADt REM shift centre to the focus xx=x+(a*e) yy=y REM Rotate point by angle T xxx=(xx*COSRADT) + (yy*SINRADT) yyy=-(xx*SINRADT) + (yy*COSRADT) IF t=1 MOVE xxx,yyy DRAW xxx,yyy NEXT G=GET ENDPROC