|
Post by krzysztof on Aug 13, 2013 6:03:23 GMT -5
I've always loved fractals. It is very interesting and exciting thing. On the site paulbourke.net/fractals there are many examples of different fractals with simple programs written in classic BASIC dialect. They can be easily converted into a RunBASIC. There is no sense to give too many examples, as they use rather simple, similar codes. Two examples are: 'Peter de Jong Attractor 'http://paulbourke.net/fractals/peterdejong/ graphic #deJong, 500, 500
x = 0 y = 0
for i = 1 to 100000 x1 = sin(1.4 * y) - cos(-2.3 * x) y = sin(2.4 * x) - cos(-2.1 * y) x = x1 #deJong set(120 * x + 250, 120 * y + 250) next i
render #deJong end and 'Gingerbread man 'http://paulbourke.net/fractals/gingerbread/ graphic #Ginger, 500, 500
x = -0.1 y = 0
for i = 1 to 100000 x1 = 1 - y + abs(x) y1 = x x = x1 y = y1 #Ginger set(40 * x + 150, 40 * y + 150) next i
render #Ginger end
|
|
|
Post by krzysztof on Aug 22, 2013 10:25:21 GMT -5
Here is the Run BASIC version of my old program, first written in Turbo Pascal ages ago. It draws a graphical representation of the logistic equation with Lyapunov exponent. 'Feigenbaum bifurcation and Lapunov exponent
graphic #Bifurcation, 500, 500
x = 0.1
for r = 4 to 0 step -0.005
s = 0 for i = 1 to 200 x = r * x * (1 - x) s = s + log(abs(r - 2 * r * x)) #Bifurcation color("black") #Bifurcation set(100 * r + 50, -400 * x + 450) next i
L = s / 200 #Bifurcation color("blue") #Bifurcation set(100 * r + 50, 50 -50 * L)
next r
render #Bifurcation end
|
|