Qbasicnews.com

Full Version: Clifford attractor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have begun on a quest to learn fractals, especially these kind of
"attractor" fractals that I find very beautiful...

[syntax="qbasic"]defdbl a-z
screen 20,32,,1
dim sprite(0 to 4) as integer
pset (0,0),rgb(255,255,255)
get (0,0)-(0,0),sprite
cls
a = 1.5: b = -1.8: c = 1.6: d = 0.9
x=0:y=0
do
i$=inkey$
x = sin(a*oy)+c*cos(a*ox)
y = sin(b*ox)+d*cos(b*oy)
put(x*175+511,y*175+383),sprite,alpha,1
ox=x
oy=y
loop while i$=""[/syntax]
That is quite interesting.
wow, i really like that, its amazing!!! do you have any links where i can go to laern about it?
Smile
http://astronomy.swin.edu.au/~pbourke/fractals/
http://astronomy.swin.edu.au/~pbourke/fr.../clifford/

These are the sites are the ones I used (except for one I can't remember)

The fractals are built like this:
1) newx=someformula based on old x/y/z and a number of constants
newy=someformula based on old x/y/z and a number of constants
and possibly newz=someformula based on old x/y/z and a number of constants
2) plot the point
old variables=new variables
3) repeat

AFAIK the formula decides what kind of attractor fractal it is
(Clifford/Peter de Jong/...), and the constants decide the looks of
the fractal of the special type.
I might write a tutorial... hmmm...
Wow, looks great! Big Grin