NaaLaa
Canabis Curve (repost) - Printable Version

+- NaaLaa (https://www.naalaa.com/forum)
+-- Forum: NaaLaa (https://www.naalaa.com/forum/forum-1.html)
+--- Forum: NaaLaa 7 Code (https://www.naalaa.com/forum/forum-4.html)
+--- Thread: Canabis Curve (repost) (/thread-175.html)



Canabis Curve (repost) - 1micha.elok - 12-20-2024

Cannabis curve
 repost from old archive
 date:08-07-2022


Code:
' ------------------------------------------------
' Cannabis curve
' repost from old archive N7 Marcus
' date:08-07-2022
' see also
' https://www.facebook.com/groups/2057165187928233
'
' control key :
' ESC to quit
' ------------------------------------------------

'set window size
#win32
set window "Cannabis curve", 640, 480
set redraw off
randomize time()

'color definition
black = [0,0,0]
green = [0,200,0]
white = [255,255,255]

'initial value
px = 0; py = 0
detail = 0.01

'Main loop
do

    set color black; cls 'clear screen

    set color rnd(100,255),rnd(50,255),rnd(50,255) 'random color of canabis curve

    for a = 0 to 2*PI step detail

        'calculate coordinate
        x = width()/2 + 100*(sin(a) + 1)*cos(a)*(9*cos(8*a)/10 + 1)*(cos(24*a)/10 + 1)*(cos(200*a)/10 + 9/10)
        y = 64+100*sin(a)*(sin(a) + 1)*(9*cos(8*a)/10 + 1)*(cos(24*a)/10 + 1)*(cos(200*a)/10 + 9/10)
   
        'each time, continue draw line from the last point
        if a > 0  then
            draw line px, py, x, y
            draw line px-5,py-5,x-5,y-5
            draw line px-10,py-10,x-10,y-10
            draw line px-15,py-15,x-15,y-15
        endif
        px = x; py = y  'swap value 
       
        'Escape to quit
        if keydown(KEY_ESCAPE,true) then end
   
        fwait 100
        redraw
    next

    fwait 100
loop



RE: Canabis Curve (repost) - johnno56 - 12-20-2024

Whoa! Far out, man! Heavy.