| |
|
|
p.specht
| The english Mathematiker Michael Barnsley employed itself in its 1993 appeared publication with Fraktalen, The in the nature vorkommen. as one the Studienobjekte showed it The Algorithms on, to them Farne (fern, english: remote, is the eldest Blattpflanze on the world) aufgebaut are.
Window Title "Barnesley´s Fractal-Farnblatt"
'Q:https://rosettacode.org/wiki/Barnsley_fern
'details: https://en.wikipedia.org/wiki/Barnsley_fern
Window Style 24:font 2:Randomize
Window 0,0-%maxx,%maxy:cls 0:showmax
declare ende&,xh&,yh&,xn!,yn!,xnp1!,ynp1!,R!,sx!,sy!,dx&,gn&,vz&
xh&=width(%hwnd)\2:yh&=height(%hwnd)*0.9
Nochmal:
WHILELOOP 35
dx&=xh&*(1-2*rnd())
sx!=64-Rnd(40)'Zoomx
sy!=64-Rnd(20)'Zoomy
gn&=35+Rnd(200):vz&=1-2*rnd(2)
xn!=0 : yn!=0'Startposition
usepen 0,2,rgb(0,gn&,0)
Whileloop 10000
RndCaller
line (xh&+dx&+sx!*xn!*vz&),(yh&-sy!*yn!) - (xh&+dx&+sx!*xn!*vz&+1),(yh&-sy!*yn!)
xn!=xnp1!:yn!=ynp1!
Endwhile
ENDWHILE
CLS 0
Goto "Nochmal"
proc RndCaller
R!=100*rnd()
if R!<=1 :ƒ1
elseif R!<=8 :ƒ3
elseif R!<=15:ƒ4
else :ƒ2
endif
endproc
proc ƒ1'(chosen 1% of the time)
xnp1! = 0
ynp1! = 0.16*yn!
endproc
proc ƒ2'(chosen 85% of the time)
xnp1! = 0.85*xn! + 0.04*yn!
ynp1! = -0.04*xn! + 0.85*yn! + 1.6
endproc
proc ƒ3'(chosen 7% of the time)
xnp1! = 0.2*xn! - 0.26*yn!
ynp1! = 0.23*xn! + 0.22*yn! + 1.6
endproc
proc ƒ4'(chosen 7% of the time)
xnp1! = -0.15*xn! + 0.28*yn!
ynp1! = 0.26*xn! + 0.24*yn! + 0.44
endproc
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/28/21 ▲ |
|
|
|