Sunflowers

Another way to generate naturalistic 'flowers' with the Fibonacci curve. Lots of variations possible!


'   Sunflower

    nomainwin

    WindowWidth   =   800
    WindowHeight  =   800

    c             =( 5^0.5 +1) /2

    numberofseeds = 13000

    Pi            =     3.14159265


    open "Sunflower" for graphics_nsb as #wg

    #wg "trapclose quit"

    #wg "fill 0 0 150 ; flush"
    #wg "color 255 0 0"


    for i =0 to numberofseeds
        r       =i^c /numberofseeds
        angle   =2 *Pi *c *i
        x       =r *sin( angle) +400
        y       =r *cos( angle) +360

        #wg "up ; goto "; int( x); " "; int( y); " ; down"

        'pix    = int( r /1.4)
        'pix    =i mod 256
        'pix     =int( i /3) mod 256
        pix =( angle *25) mod 256
        col$    =str$( pix); " "; str$( 256 -pix); " 50"

        #wg "backcolor "; col$
        #wg "circlefilled "; 4

    next i

    #wg "getbmp scr 1 1 800 800"

    bmpsave "scr", "sunflowerJhf9.bmp"

    wait

    sub quit h$
        close #wg
        end
    end sub