Computer Science Canada

Spinning Flower

Author:  The_Bean [ Mon Apr 07, 2008 5:48 pm ]
Post subject:  Spinning Flower

It's using polar coordinates to make a flower with a smiley face inside.

Turing:

View.Set ("graphics:500,500,title:Turing Flower,offscreenonly,nobuttonbar")
var x1, y1, x2, y2, a : int
var r, n : real
n := 5
a := 250
loop
    for k : 0 .. 360
        cls
        Draw.FillBox (0, 0, maxx, maxy, 7)
        for t : 0 .. 360
            r := sind ((t + k) * n) * a
            x1 := round (cosd (t) * r) + maxx div 2
            y1 := round (sind (t) * r) + maxy div 2
            r := sind ((t + 1 + k) * n) * a
            x2 := round (cosd ((t + 1)) * r) + maxx div 2
            y2 := round (sind ((t + 1)) * r) + maxy div 2
            Draw.Line (x1, y1, x2, y2, 5)
        end for
        for i : 1 .. round(n)
            x1 := round (cosd (i * 72 - k + 18) * a / 4 * 3) + maxx div 2
            y1 := round (sind (i * 72 - k + 18) * a / 4 * 3) + maxy div 2
            Draw.Fill (x1, y1, 5, 5)
        end for
        Draw.FillOval (maxx div 2, maxy div 2, 50, 50, 43)
        for i : 235 .. 315
            x1 := round (cosd (i - k) * 35) + maxx div 2
            y1 := round (sind (i - k) * 35) + maxy div 2
            Draw.FillOval (x1, y1, 5, 5, 7)
        end for
        x1 := round (cosd (50 - k) * 30) + maxx div 2
        y1 := round (sind (50- k) * 30) + maxy div 2
        Draw.FillOval (x1, y1, 7, 7, 7)
        x1 := round (cosd (130 - k) * 30) + maxx div 2
        y1 := round (sind (130 - k) * 30) + maxy div 2
        Draw.FillOval (x1, y1, 7, 7, 7)
        View.Update
        delay (5)
    end for
    exit when hasch
end loop

Author:  repsoccer16 [ Tue Apr 08, 2008 8:09 am ]
Post subject:  RE:Spinning Flower

pretty good but this is basically the omg trippy cool flashes group thing...remember to think what you are going to post before you post it and see if it is good enough.

Author:  Mackie [ Tue Apr 08, 2008 10:19 am ]
Post subject:  RE:Spinning Flower

This has some merit, it shows how to use rotation. I say it's not OMG tripy flash thing at all.

Author:  petree08 [ Tue Apr 08, 2008 10:48 am ]
Post subject:  RE:Spinning Flower

Nah, this isn't "OMG trippy... "

there is an actual mathimatical process being followed here.

Now if it was just drawing random circles or a flashy box then it could be considered.

This is pretty neat

Author:  Tallguy [ Tue Apr 15, 2008 9:51 am ]
Post subject:  RE:Spinning Flower

ha ha i like it good job, can u do that for any object?

Author:  The_Bean [ Tue Apr 15, 2008 7:41 pm ]
Post subject:  Re: Spinning Flower

Yes and No depending on what you mean by any object.

Author:  crysis [ Wed Apr 16, 2008 8:25 am ]
Post subject:  RE:Spinning Flower

cool program

Author:  repsoccer16 [ Wed Apr 16, 2008 8:30 am ]
Post subject:  RE:Spinning Flower

ya true it isn't the omg trippy and it is pretty cool...sry for previous comment.

Author:  andrew. [ Fri Apr 18, 2008 9:08 pm ]
Post subject:  RE:Spinning Flower

The program is a bit slow to exit though. It takes about 10 seconds. Maybe it's my computer. But otherwise good, I attempted to make a rotating image a while back but failed as it just kept eating Windows' resources.

Author:  The_Bean [ Mon Apr 21, 2008 7:21 pm ]
Post subject:  Re: Spinning Flower

it only takes that long to exit because of the placement of the exit when
and im developing a Draw.Flower(x,y,xRad,yRad,petals,colour 1,colour 2)

Author:  crysis [ Tue Apr 22, 2008 8:39 pm ]
Post subject:  RE:Spinning Flower

try to make it so the leaves change and the center changes


: