B€mw2.0 Englishprojectsize[744 426]turtles-have[]globals[]globals-list[globals-vars] shapes§procedures˜text{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2 System;}{\f3\fswiss Arial;}{\f4\fmodern\fprq1 Courier New;}} {\colortbl\red0\green0\blue0;\red0\green128\blue128;\red0\green0\blue255;\red255\green0\blue0;\red0\green255\blue64;} \deflang1033\pard\plain\f4\fs20\cf1 ; Purpose: To create an IFS Fractal \par ; Copyright \plain\lang3081\f4\fs20\cf1 \'a9\plain\f4\fs20\cf1 2004 by Rupert Russell \par ; e-mail: r.russell@ballarat.edu.au \par ; URL: http://velorum.ballarat.edu.au/~rrussell/microworlds/ \par ; Created: October 10, 2004 \par ; \par ; Based on code from: \par \plain\f4\fs20\cf1\b ; Bill Beaumont Paul Scott\plain\f4\fs20\cf1 \par ; w.beaumont@computer.org mail@paulscott.info \par ; http://www.bold.net.au/~willy http://paulscott.info \par \plain\f4\fs16\cf2 ; http://www.maths.adelaide.edu.au/people/pscott/fractals/fu11.html#Anchor55555\plain\f4\fs20\cf1 \par ; \par ; This program is free software; you can redistribute it and/or modify \par ; it under the terms of the GNU General Public License as published by \par ; the Free Software Foundation; either version 2 of the License, or \par ; (at your option) any later version. \par ; \par ; This program is distributed in the hope that it will be useful, \par ; but WITHOUT ANY WARRANTY; without even the implied warranty of \par ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \par ; GNU General Public License for more details. \par ; \par ; You should have received a copy of the GNU General Public License \par ; along with this program; if not, write to the Free Software \par ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. \par ; ----------------------------------------------------------------------\plain\f4\fs20\cf0 \par \plain\f4\fs20\cf1 ;\plain\f4\fs20 \par \plain\f4\fs20\cf1 ; Version 10 \par ; \par ; The formula for an IFS fractal is: \par \plain\f4\fs20\cf1\b ; Xn+1 = AXn + BYn + C \par ; Yn+1 = DXn + EYn + F\plain\f4\fs20 \par \par \plain\f4\fs20\b to dot\plain\f4\fs20 \par ht \par make "scale IFS_sz\tab \tab \plain\f4\fs20\cf1 \tab ; IFS_sz is a slider range 1 - 400 \par \plain\f4\fs20 ; setc (random 5) + 100\tab \tab \plain\f4\fs20\cf1 ; add some colour\plain\f4\fs20 \par ; setc "black \tab \tab \tab \plain\f4\fs20\cf1 ; or stick to Black \par \tab \tab \tab \tab \tab \tab ; note the colours are currently \par \tab \tab \tab \tab \tab \tab ; set in the \plain\f4\fs20\b ChooseRule \plain\f4\fs20\cf1 procedure\plain\f4\fs20\b \plain\f4\fs20 \par \par setx :x * :scale \par sety :y * :scale - (:scale / 2) \par \par pd \par fd 0\tab \tab \tab \tab \tab \par pu \par \plain\f4\fs20\b end \par \par to rule1 \par \plain\f4\fs20\cf1\b ; Xn+1 = AXn + BYn + C \par ; Yn+1 = DXn + EYn + F\plain\f4\fs20 \par \par make "a 0 \par make "b 0 \par make "c 0 \par make "d 0 \par make "e 0.16 \par make "f 0 \par \par make "t (:a * :x) + (:b * :y) + :c \par make "y (:d * :x) + (:e * :y) + :f \par make "x :t \par \plain\f4\fs20\b end \par \par to rule2 \par \plain\f4\fs20 make "a 0.85 \par make "b 0.04 \par make "c 0 \par make "d -0.04 \par make "e 0.85 \par make "f 0.16 \par \par make "t (:a * :x) + (:b * :y) + :c \par make "y (:d * :x) + (:e * :y) + :f \par make "x :t \par \plain\f4\fs20\b end \par \par to rule3 \par \plain\f4\fs20 make "a 0.2 \par make "b -0.26 \par make "c 0 \par make "d 0.23 \par make "e 0.22 \par make "f 0.16 \par \par make "t (:a * :x) + (:b * :y) + :c \par make "y (:d * :x) + (:e * :y) + :f \par make "x :t \par \plain\f4\fs20\b end \par \par to rule4 \par \plain\f4\fs20 make "a -0.15 \par make "b 0.28 \par make "c 0 \par make "d 0.26 \par make "e 0.24 \par make "f 0.08 \par \par make "t (:a * :x) + (:b * :y) + :c \par make "y (:d * :x) + (:e * :y) + :f \par make "x :t \par \plain\f4\fs20\b end \par \par to ChooseRule \par \plain\f4\fs20\cf1 ; chose a rule based on its probability\plain\f4\fs20 \par make "r random 100 \par if :r = 0 [setc \plain\f4\fs20\cf3 "red \plain\f4\fs20 rule1 stop] \par if :r < 83 [setc \plain\f4\fs20\cf4 "green\plain\f4\fs20 rule2 stop] \par if :r < 92 [setc \plain\f4\fs20\cf2 "blue\plain\f4\fs20 rule3 stop] \par setc "black rule4 \par \plain\f4\fs20\b end \par \par to IFS :n\plain\f4\fs20 \par pu \par make "x 0 \par make "y 0 \par repeat :n [ChooseRule dot] \par \plain\f4\fs20\b end\plain\f4\fs20 \par \par } %mpagenamepage1curturtlet1curtext||transition0Dturtle-deamons[[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]Cmouse-deamons[[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]bg0Ľibuffer誎i$6HZl~˘´ĆŘę2Jg—ľŇđ,Jh’°Îř@^ˆŹĘî;e‰§ĘîBfЍĚđ NxœŔę8bŒść?i“˝ç 5 _ “ ˝ ç  J q ˜ Ë ö  8 Y € ­ Ů ? k ž Ü  G y ž Ë ř @q¤×H†­Ů-e˜Ĺü)V}ž× =‡Ĺ=vŽćJˆĆó&vŻŰ/h§ŕXá*cŽ÷Exˇő3e˜ËG€Ĺ7|ťô8ƒÂLŁçY¤ď= ‚ Ŕ !H!‡!Ă!"J"ˆ"â"#M#’#Ý#:$s$˝$%E%Š%Ú%0&s&Â&'X'Ł'ů'B(‡(Ň()r)Í)#*l*ś* +K+•+ö+],˛,-G-…-Ü-8..ń.R/˘/ó/80ˆ0Ŕ01t1Ä12{2Ń2"3z3Đ3!4}4Ů4L5—5č5=6ž67c7×748…8Ö8>9Ť9:L:˘: ;U;ą;<j<Ć< =…=á=H>Ż>?e?Š?ó?e@Ă@7A—ABnBČB!CŒCëCMDŞDEnEĐE>F™FGmGÖGGH¸HIlIÉI