                           CURVE GENERATORS.
                           ~~~~~~~~~~~~~~~~~

This Directory contains a number of simple single-tasking Basic programs which generate curves of various kinds. The curves are traced on the screen as black on white or with colour (in some cases) and on termination of the program the screen is saved. For the convenience of the user I have made (=bodged up) an arrangement whereby the screen is always saved to a Sprite file [CurveResult] in the same directory as the programs, wherever this is located. In order to make use of this, double-click on the Obey file called START and follow the instructions in the Basic window. If you wish to save the curves permanently simply copy "CurveResult" to somewhere else and change the filename.
It is not strictly necessary to use this access process and individual programs may be run in the usual way - however, unless START has been previously run, the resulting curve may not be saved.

As mentioned above, these programs are experimental and I don't regard them as copyright in any way. Please feel free to modify them as you please. Those that have Data Sets can have these added to - some information is given below.

Group 1 - Chaos Curves.
~~~~~~~~~~~~~~~~~~~~~~~
Select 1 [CG_RPC_01X]  This uses linear equations:-
         xn=a*x+b*y+e  <----|           
         yn=c*x+d*y+f       |
         x=xn: y=yn    ---->|

These sometimes form a "Strange Attractor" but often "Fly of to Infinity", depending on the parameters. To deal with this there is a "Catcher" that terminates the program and saves the screen if the numbers get too large.
Four sets of data are provided.

Select 2 [CG_RPC_02]  This uses Cubic equations@-
         xn=a1*x^3+a2*y+a3   <----|
         yn=b1*y^3+b2*x+b3        |                  
         x=xn: y=yn          ---->|

These also tend to "Fly of to Infinity" and has the "Catcher".
Three sets of data are provided.

Select 3 [CG_RPC_03]  This uses Quartic equations:-
         xn=a1*x^4+a2*y+a3  <----|
         yn=b1*y^4+b2*x+b3       |                   
         x=xn: y=yn         ---->|

These mostly form "Strange Attractors" but a "Catcher is provided.
Press the Space Bar to terminate the program.
Five sets of data are provided.

Select 4 [CG_RPC_04]   This is a type of Chaos Curve but used Trigonometric Functions:-
         xn=SIN(a1*x)+COS(a2*y)+a3   <----|
         yn=SIN(b1*y)-COS(b2*x)+b3        |                  
         x=xn: y=yn                  ---->|

These seem mostly to form closed figures but may "Fly of to Infinity" so a "Catcher" is provided. Five sets of data are provided.
Press the Space Bar to terminate the program.

Select 5 [CG_RPC_05]   This uses Reciprocals of the variables:-
         xn=a1*x+a2/y+a3  <----|
         yn=b1*y+b2/x+b3       |                   
         x=xn: y=yn       ---->|

Press the Space Bar to terminate the program.

Select 6 [CG_RPC_06]  This is similar to No. 4 but the cosine functions are squared.
         xn=SIN(a1*x)+COS(a2*y)^2+a3   <----|
         yn=SIN(b1*y)-COS(b2*x)^2+b3        |                  
         x=xn: y=yn                    ---->|

Press the Space Bar to terminate the program.

Select 7 [CG_RPC_1A]   This uses Quadratics and has a facility to save intermediate stages of the process. 
The user can set the number of iterations per stage, the total number of stages being (at present) 10. These are saved as Sprite Files named CurveResult1 to CurveResult10. The number of intermediate results maybe changed by changing the number in the expression
"IF ct% = 11 THEN END" in line 23.

Select 8 [CG_RPC_1AX]  This is basically similar to No. 7 but only produces a single result (Saved as CurveResult).
         xn=a1*x^2+a2*y+a3   <----|
         yn=b1*y^2+b2*x+b3        |                  
         x=xn: y=yn          ---->|

However, the number of iterations is set by the user. This needs to be of the order of 100000 to get a reasonable figure.


Group 2 - Roulards (Cycloids).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Select 1 [CG_RPC_08]   This program produces simple epicycloids on a circle. It assumes that the tracing point is situated on the circumference of the rolling circle. The radii of the large and small (rolling) circles may be set by the user (in pixels).

Select 2 [CG_RPC_09]   This is similar to No.1 but assumes that the tracing point is situated on an extended radius of the rolling circle. This may be set by the user as the parameter "k" which may be smaller or greater than unity. [When k =1 it is the same as No.1]

Select 3 [CG_RPC_10]   No.3 is a slightly more complex version of Nos. 1 & 2 and allows the large circle to be drawn.

Select 4 [CG_RPC_11]  As for No. 3 but uses a larger screen size - 1280 x 1024
pixels.

Select 5 [CG_RPC_12]  This program generates an Epicycloid on an Ellipse. The total number of steps is set by the user and needs to be of the order of 2000 upwards. In general the rolling circle will not finish up in the same place when it has rolled round the ellipse once. It is not possible to guess (or to calculate simply) the relationship between the periphery of an ellipse and the lengths of the axes, so ensuring that the rolling circle finishes in the same place that it started, before the program is run, is not realistic. It can be done, but the program is no longer simple (See the Application !Roulards). The path of the centre of the rolling circle is traced (in blue).

Select 6 [CG_RPC_13]  This is similar to No. 5 but the number of steps is not pre-determined. The tracing continues until the user presses the Space Bar.

Select 7  [CG_RPC_14]  Similar to No.6 but the rolling circle goes round the ellipse a fixed number of times, as set by the user.


 Group 3 - Other Curves.
 ~~~~~~~~~~~~~~~~~~~~~~~
Select 1 [CG_RPC_07]   This program uses Trigonometric Functions to generate complex Lissajous Figures. These are not Chaos Curves as in Group 1 (Select 6).
Five data sets are provided.

Select 2 [OCGen_1]   -  Cardoid  
Select 3 [OCGen_2]   -  Limacon
Select 4 [OCGen_8]   -  Astroid
Select 5 [OCGen_9]   -  Nephroid
Select 6 [OCGen_7]   -  Deltoid
Select 7 [OCGen_3]   -  Equiangular Spiral
Select 8 [OCGen_4]   -  Lemniscate of Bernoulli
Select 9 [OCGen_10]  -  Catenary
Select 10 [OCGen_5]  -  Cissoid of Deocles
Select 11 [OCGen_6]  -  Parallel Spiral

These generate "Classical" curves as designated. I got the formulae from a library book but have no record of the relationship between the the parameters and the dimensions of the actual figures. Sorry.  They may be useful to somebody. [See Textfile "CurveEqu]".


Data Sets.
~~~~~~~~~~
The Format of the Chaos Curve Data Sets is as follows:-

DATA "CurveN"
DATA x0,y0
DATA a1,a2,a3
DATA b1,b2,b3
DATA k1,k2

Where:-
     N is a sequential upper-case letter eg. A,B,C,D,E,F etc. used to select the Data Set.
     
     x0 & y0 are the initial values of x & y; ie. the starting point of the curve. These are usually set at or near zero.
     
     a1, a2 and a3 are the coefficients of the first equation. For typical values see the provided Data Sets.
     
     b1, b2 and b3 are the coefficients of the second equation. For typical values see the provided Data Sets.
     
     k1 and k2 are the X & Y Scaling factors to ensure that the curve fits on the screen.  
