A downloadable tool

PUR80 – Epicycle_bas demo by Stephen Poole, (QL Forum).

[Moved to category SCHAU, because it isn't a game; the organizer]

 

 

Code written and tested on QL and QPC2 (QL emulator).

_________________

 

The original QL possessed two microdrive tape readers. These are now hard to find. Floppy disc readers could be installed, but are now rare. MSDOS and QDOS discs are formatted differently, but both types can be accessed by the ‘QPC2’ QL emulator. With this readme file, comes a program file which QPC2 will run.

But the simplest way to access the files is to UNZIP and copy them to a USB key, (which will be referred to by QPC2 as dos2_ , dos3_ or dos4_ etc).

_________________ 

 

On PCs : Download QPC2 from its website onto your PC. Unzip, then click on the QPC2 appfile. Set ‘resolution’ to 512x256 and hit ok. 

 

_________________

 

Watch until the animation halts.

 

___________________

 

 

 

 

 

 

 

 

1 WINDOW 512,256,0,0:SCALE 180,-180,-90:PAPER 0:MODE 8:CLS:AT 1,1:CSIZE 3,1
 2 PRINT'EPicycles':PAUSE 250:CLS:DIM q$(1):p=2*PI:h=30:i=RAD(3):FOR t=1 TO 6
 3 IF t<4:i=RAD(6):END IF :AT 0,1:PRINT'Rank '!t,:q=p/t:k=t:FOR c=q/2,q/4,i
 4 INK k:AT 1,1:PRINT c,:b=32766:u=640:a$='Angle':v=.76:FOR r=-h TO h STEP 20
 5 AT 2,1:PRINT a$!r!!:o=r+30:l=o+48:FOR j=-1,1:a=r*j:e=a+h:k=k+1:k=k MOD 7:zz
 6 END FOR r:k=1:END FOR c::PAUSE h:CLS:END FOR t:WINDOW#2,480,206,0,0:PAUSE u
 7 DEFine PROCedure zz
 8 IF k=0:k=1:END IF :INK k,t,0:PAUSE h:BEEP b,o,l,u,j,3:FOR f=0 TO p+c STEP c
 9 d=f*j:g=f*t+d:s=SIN(g):z=e*COS(d):x=z+r*COS(g):w=e*SIN(d):PAUSE 1:y=w+r*s
 10 IF f:LINE m*v,n TO x*v,y:END IF :m=x:n=y:NEXT f:BEEP b,o,l,u,j,3:END DEFine
  

 

___________________

 

Program description :

 

1 Full screen : Vertical scale : black paper : 8 colours : blackout :

  at top left : big characters 

2 print title : pause 5 secs : blackout : Dimension Q$ ? : p circumference :

  h 30°: i 3° in radians : for i(rank) = 1 to 6

3 if rank<4 i=6° in radians : end if : on 2nd row print rank : q no. of cycles :

  k colour : for c sectors 1/2,1/4,i°

4 ink colour : b beep duration : u beep xstep : a$ message : v aspect ratio :

  for r orientation & height = -30 to 30 step 20

5 print angle of r : o pitch1 : l pitch 2 : for j =-1,+1 width or height halves 

  a get the orientation : e add 30° : k change colour : ink as rank : zz draw

6 end for orientation & height : colour red :

  end for sectors : pause 1/2sec : blackout :

  end for rank : set listing screen : pause 13 secs

7 DEFine  draw routine

8 if k=0 black ink : k irridessence : pause 1/2sec : beep warble merrily :

  for f sectors around circumference 

9 d ajacent side : g opposite side rank§or : s SIN(opposite) :

  z COS(adjacent)*added_angle : x z+(orientation & height)*COS(g)

  w COS(g)*SIN(ajacent)*added_angle : pause 1 sec : y=w+rank*s

10 if any sector : draw line arc sector : m & n are end coordinates :

  end for f sectors :  Beep warbling merrily : End of routine definition

 

________________________

 

This program was rapidly written at short notice, using a few of the QL’s built in features. It is based on a much longer highly commented program I wrote.

(It took weeks to construct from simple mathematical principals).

 

The description is very difficult to follow, as the code is highly imbricated...

The SCALE command sets the 0,0 coordinates near the screen center. So by using negative, 0 or positive x,y values, we can use whole-circle polar coordinates.

The several FOR loops use these (– 0 +) ranges in combination, to access all quarters of the screen.

 

Epicycles have straight lines when the arc-sectors have the same value as the segment values. Please realise that the rotating or contra-rotating ‘discs’ have a slipping peripheral point, (which is represented by the orbital trace). This is why we can get so many different orbital designs from so little code.

___________________________

 

Any time the program halts, just type in RUN and hit ENTER.

 

____________________________

Download

Download
Epicycle.odt 275 kB
Download
epicycleflix.mp4 14 MB
Download
epicycleQ.bas 716 bytes

Comments

Log in with itch.io to leave a comment.

What is an .odt file?

Open document text. Word, Open Office and LibreOffice are able to handle it.