Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!stl!stc!james From: james@tcom.stc.co.uk (James Rouse) Newsgroups: comp.graphics Subject: Re: Fractals Keywords: Postscript, Barnsley's fractals Message-ID: <764@jura.tcom.stc.co.uk> Date: 23 Feb 89 10:35:11 GMT Organization: STC Telecomms, Access Systems Engineering, Harlow. ESSEX Lines: 37 Charles Culmer writes of Barnsley's method for generating fractals. I saw an Equinox program on chaos and that also described his fern; so I drew it. The following is a postscript program, sorry you'll have to convert it. (Yes Adrain the code probably is horrible :-)) ---------------cut---------------------cut-----------------cut-------------- %! -50 0 translate /Helvitica findfont 10 scalefont setfont /xpos 350 def /ypos 383 def xpos ypos moveto /cho %generate a random number from 0 to 2 {/num rand 3 mod def} def %mod 3 on 2^31-1 /one {/xpos xpos 100 add 2 div def %point one at 100,600 /ypos ypos 600 add 2 div def} def /two {/xpos xpos 600 add 2 div def %point two at 600,600 /ypos ypos 600 add 2 div def} def /three {/xpos xpos 350 add 2 div def %point three at 350,167 /ypos ypos 167 add 2 div def} def 1 1 5000 { pop %plots 5000 points and takes ~2mins. cho %increase the 5000 for more points. num 0 eq {one} if num 1 eq {two} if num 2 eq {three} if xpos ypos moveto (.) show} for %plot a point at the currentpoint. showpage ----------cut---------------------cut-----------------cut------------------ I hope this helps, Jim Zaxspeed