Path: unixg.ubc.ca!cs.ubc.ca!destroyer!gumby!wupost!howland.reston.ans.net!zaphod.mps.ohio-state.edu!menudo.uh.edu!nuchat!dwarp!wesley.loewer From: wesley.loewer@dwarp.sccsi.com (Wesley Loewer) Newsgroups: sci.fractals Subject: IFS examples Message-ID: <217.523.uupcb@dwarp.sccsi.com> Date: 6 Mar 93 18:38:00 GMT Distribution: world Organization: Data Warp Premium BBS - Spring/Houston, TX - 713-355-6107 Reply-To: wesley.loewer@dwarp.sccsi.com (Wesley Loewer) Lines: 79 AI>Could anyone give me some simple examples of IFS that could AI>generate fractals in a 2d space Concerning IFS examples, perhaps the following might be of interest to you and others. A couple of years ago I got really interested in polygons formed by IFS definitions, in particular regular polygons that just touch each other. I don't know if the following is common knowledge or something that I discovered, but here's what I came up with. The proof for this is a bit hard to describe via 7 bit ascii, but here are the results. If you want an n_gon sided polygon (ie: n_gon=3 for Sierpinski Triangle), For the IFS definition |x'| = |a b| * |x| + |e| with a probability p |y'| |c d| |y| |f| use a = 1-r b = 0 c = 0 d = 1-r e = r * sin(k*x); f = r * cos(k*x); p = 1 / n_gon where k = line number (ie: k=0, k=1, ..., k=n_gon-1) r = 1 - 1 / (2 * s) s = cos(n_angles*x/2) * sin((n_angles+1)*x/2) / sin(x/2) n_angles = integer part of (n_gon-1)/4 x = 2 * pi / n_gon (or 360/n_gon in degrees) (also, if n_gon is odd try r = 1 + 1 / (2 * s) for an interesting "inverted" polygon) For example, using n_gon=3 gives the following 3 lines ThreeMinus { ; Sierpinski Triangle 0.5 0.0 0.0 0.5 0.0 0.5 0.333333 0.5 0.0 0.0 0.5 0.433013 -0.25 0.333333 0.5 0.0 0.0 0.5 -0.433013 -0.25 0.333333 } ThreePlus { ; using r = 1 + 1 / (2 * s) -0.5 0.0 0.0 -0.5 0.0 1.5 0.333333 -0.5 0.0 0.0 -0.5 1.299038 -0.75 0.333333 -0.5 0.0 0.0 -0.5 -1.299038 -0.75 0.333333 } FiveMinus { 0.381966 0.0 0.0 0.381966 0.0 0.618034 0.2 0.381966 0.0 0.0 0.381966 0.587785 0.190983 0.2 0.381966 0.0 0.0 0.381966 0.363271 -0.500000 0.2 0.381966 0.0 0.0 0.381966 -0.363271 -0.500000 0.2 0.381966 0.0 0.0 0.381966 -0.587785 0.190983 0.2 } FivePlus { -0.381970 0.0 0.0 -0.381970 0.0 1.381970 0.2 -0.381970 0.0 0.0 -0.381970 1.314332 0.427052 0.2 -0.381970 0.0 0.0 -0.381970 0.812302 -1.118037 0.2 -0.381970 0.0 0.0 -0.381970 -0.812302 -1.118037 0.2 -0.381970 0.0 0.0 -0.381970 -1.314332 0.427052 0.2 } Six { 0.333333 0.0 0.0 0.333333 0.0 0.666667 0.166667 0.333333 0.0 0.0 0.333333 0.577351 0.333334 0.166667 0.333333 0.0 0.0 0.333333 0.577351 -0.333333 0.166667 0.333333 0.0 0.0 0.333333 0.000000 -0.666667 0.166667 0.333333 0.0 0.0 0.333333 -0.577351 -0.333334 0.166667 0.333333 0.0 0.0 0.333333 -0.577351 0.333333 0.166667 } Hope someone finds this interesting, -wes ---- +------------------------------------------------------------------------+ | Data Warp Premium BBS (713) 355-6107 HST/V.32bis | | Spring / Houston, Texas Multi-line, multi-gig PCBoard BBS | +------------------------------------------------------------------------+