PART 2: PLANET X
So
'Planet X ACLS X=200 Y=120 XFACTOR1=RND(450)/100 XFACTOR2=RND(200)/100 LOCATE 0,0 PRINT "XFACTOR1: ";XFACTOR1 LOCATE 0,1 PRINT "XFACTOR2: ";XFACTOR2 @LOOP ANGLE=RAD(T) RADIUS=55+(BLUE/3) XX=RADIUS*COS(ANGLE) YY=RADIUS*SIN(ANGLE) @MOON ANGLE=RAD(TT) RADIUS=35 RED=XX*3 GREEN=GREEN-0.7 BLUE=(RED/2)+(GREEN/3) IF GREEN<=0 THEN GREEN=GREEN+RND(30)+70 XX2=RADIUS*COS(ANGLE) YY2=RADIUS*SIN(ANGLE) GCIRCLE X+XX+XX2,Y+YY+YY2,6,RGB(RED,GREEN,BLUE) @TIMERS T=T+3.7-(TT*XFACTOR1) IF T>=360 THEN T=T-360 IF T<=-360 THEN T=T+360 TT=TT+4.9-(T/XFACTOR2) IF TT>=360 THEN TT=TT-360 IF TT<=-360 THEN TT=TT+360 GOTO @LOOPThis is my Planet X source code. if you plug in the two factor numbers in the screen shot you will get those patterns. it's a really interesting look at what messing around with irregular orbits would look like. this one I disabled the +(BLUE/3) to get a less chaotic pattern. Plus the random nature of these patterns can be animated by adding a timer to change one or both of the XFactors every 12,000 steps. (Although I recommend adding a GCLS when it changes. So this is all well and good, but lets look at a different application of this knowledge. Drawing shapes that rotate on a point. Let's start simple with an equilateral Triangle.
@LOOP GCLS FOR I=0 to 3 'four steps total TR=I*120 ANGLE=RAD(TR+T) RADIUS=65 X1=X0 Y1=Y0 X0=(RADIUS*COS(ANGLE)+200) Y0=(RADIUS*SIN(ANGLE)+120) IF I!=0 THEN GLINE X0,Y0,X1,Y1,#WHITE NEXT GPAINT 200,120,RGB(150,120,30) T=T+2.7 IF T>=360 THEN T=T-360 VSYNC 1 GOTO @LOOPThe triangle writes to the graphic screen one side at a time and then after all the ends match up, the GPAINT can fill the space with out any gaps. (The gap check is why you check for 4 points on a three point triangle. OPTIONAL THING 1: You can draw a spiral with almost the same setup. Change the number of steps in I by 20, 50 or even 100, start with a small radius, RADIUS=20+(I*2) and change the angle multiplier to be a little smaller. TR=I*7 OPTIONAL THING 2: Try changing the shape of the triangle by entering 3 IF statements to change the value of TR for I 0-3. (Just make certain to set value 0 and 3 the same. PART 3: Complicated shapes and shading tricks?!