////////////////////////////////////////////////////////////////// // // // Universe: Ultra-SiMPLE // // // // Task: drawmand_sys (Float2 x, Float2 y, Float2 mag) // // // // Description: Draws a magnified view of the Mandelbrot set // // (Press the Esc key to halt plotting) // // // // Parameters: Float2 x: The x-coordinate (real) of the // // center of the image // // Float2 y: The y-coordinate (imaginary) of // // the center of the image // // Float2 mag: The magnification factor to be // // used for displaying the image // // // // Example: Ultra-SiMPLE // // drawmand_sys (-0.89162, 0.23527, 3000) @ // // wait quitkey // // Append L: drawmand // // // // Author: SiMPLE CodeWorks // // // ////////////////////////////////////////////////////////////////// Task drawmand_sys (Float2 x, Float2 y, Float2 mag) limitx=150*(Log(mag)+1) If (limitx>32767) limitx=32767 limit=Int(limitx) step=0.004/mag left=x-step*Xpixels()/2 top=y+step*Ypixels()/2 Cls; Hide mouse //Generate the "quick-look" view Do yy=0,ypixels()-1,3 y=top-step*(yy) Do xx=0,xpixels()-1,4 x=left+step*(xx) z=Mandelbrot(x,y,limit) If (z!=limit) Putrgbpixel (xx, yy, Rainbow(-2*z)) Loop xx If (Readkey(27)) Return Loop yy //Fill in the rest of the image Do yy=ypixels()-1,0 y=top-step*(yy) Do xx=xpixels()-1,0 If xx%4=0 And yy%3=0 Continue x=left+step*(xx) z=Mandelbrot(x,y,limit) If (z!=limit) Putrgbpixel (xx, yy, Rainbow(-2*z)) Loop xx If (Readkey(27)) Return Loop yy //Fill in the "faint" stuff Do yy=0,ypixels()-1 y=top-step*(yy) Do xx=0,xpixels()-1 x=left+step*(xx) If (iso_sys (xx, yy)) Continue z=Mandelbrot(x,y,999999L) If (z!=999999L) Putrgbpixel (xx, yy, Rainbow(-2*z)) Loop xx If (Readkey(27)) Return Loop yy Do yy=ypixels()-1,0 y=top-step*(yy) Do xx=xpixels()-1,0 x=left+step*(xx) If (iso_sys (xx, yy)) Continue z=Mandelbrot(x,y,999999L) If (z!=999999L) Putrgbpixel (xx, yy, Rainbow(-2*z)) Loop xx If (Readkey(27)) Return Loop yy Int iso_sys (Int xx, Int yy) If (Getrgbpixel (xx, yy )) Return 1 If (Getrgbpixel (xx-1, yy-1)) Return 0 If (Getrgbpixel (xx-1, yy )) Return 0 If (Getrgbpixel (xx-1, yy+1)) Return 0 If (Getrgbpixel (xx, yy-1)) Return 0 If (Getrgbpixel (xx, yy+1)) Return 0 If (Getrgbpixel (xx+1, yy-1)) Return 0 If (Getrgbpixel (xx+1, yy )) Return 0 If (Getrgbpixel (xx+1, yy+1)) Return 0 Return 1