Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

fractel Mandelbrot

Edit 0 1 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

bluatigro bluatigro Apr 4, 2010

WindowWidth = DisplayWidth WindowHeight = DisplayHeight nomainwin global mx , my , d , winx , winy , pi pi = atn( 1 ) * 4 winx = WindowWidth winy = WindowHeight prompt "Mid X =" ; x$ prompt "Mid Y =" ; y$ prompt "Diam =" ; d$ mx = val( x$ ) my = val( y$ ) d = val( d$ ) if d < 1e-13 then d = 1e-13 open "Madelbrot"for graphics as #m #m "trapclose [quit]" for x = 0 - winx / 2 to winx / 2 for y = 0 - winy / 2 to winy / 2 cx = x / winx * d + mx cy = y / winy * d + my zx = cx zy = cy tel = 0 while sqr( zx ^ 2 + zy ^ 2 ) < 50 and tel < 36 hx = zx ^ 2 - zy ^ 2 + cx hy = 2 * zx * zy + cy zx = hx zy = hy tel = tel + 1 wend r = sin( rad( tel * 10 ) ) * 127 + 128 g = sin( rad( tel * 10 - 120 ) ) * 127 + 128 b = sin( rad( tel * 10 + 120 ) ) * 127 + 128 #m "color " ; r ; " " ; g ; " " ; b if tel = 36 then #m "color black" #m "goto " ; x + winx / 2 ; " " ; y + winy / 2 #m "down" #m "set " ; x + winx / 2 ; " " ; y + winy / 2 #m "up" next y next x #m "flush" wait function rad( deg ) rad = deg * pi / 180 end function [quit] close #m end
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...