Computer Science Canada

Awesome graphs

Author:  Homer_simpson [ Tue Mar 16, 2004 1:16 pm ]
Post subject:  Awesome graphs

bored
code:

colorback (black)
cls
setscreen ("offscreenonly")
var y, x := 0.0;

color (white)
for t : 1 .. 36000
    x := (sin (t / 10) * 300) * sin (t)
    y := (cos (t / 10) * 200) * sin (t)
    drawdot (round (x) + 320, round (y) + 200, white);
end for
View.Update


code:
colorback (black)
cls
setscreen ("offscreenonly")
var y, x := 0.0;

color (white)
for t : 1 .. 36000
    x := (sin (t / 10) * 300) * cos (t)
    y := (cos (t / 10) * 200) * sin (t)
    drawdot (round (x) + 320, round (y) + 200, white);
end for
View.Update

Author:  Homer_simpson [ Tue Mar 16, 2004 1:26 pm ]
Post subject: 

code:

setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for i : 3 .. 11
    for t : 1 .. 36000
        x := (sin (t / 10) ** i) * 200
        y := (cos (t / 10) ** i) * 100
        drawdot (round (x) + 320, round (y) + 200, white);
    end for
end for
View.Update



this one will take a while to load
code:
setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for i : 1 .. 399 by 2
    for t : 1 .. 3600
        x := (sin (t / 100) ** 1) * 200
        y := (cos (t / 100) ** i) * 100
        drawdot (round (x) + 320, round (y) + 200, white);
    end for
end for
View.Update



code:
setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for t : 1 .. 36000
    x := ((cos (t / 100)) * 100) + t / 100
    y := ((sin (t / 100)) * 200) + t / 100
    drawdot (round (x), round (y), white);
end for
for decreasing t : 36000 .. 1
    x := ((cos (t / 100)) * 100) + t / 100 + 360
    y := ((sin (t / 100)) * 200) + 360 - (t / 100)
    drawdot (round (x), round (y), white);
end for
View.Update


Author:  AsianSensation [ Tue Mar 16, 2004 2:13 pm ]
Post subject: 

funky, I especially liked the one that took a long time to load, looked like a big giant eye.

Author:  Cervantes [ Tue Mar 16, 2004 5:59 pm ]
Post subject: 

looks cool. I also like the eye one Smile

I notice you've got a bunch of semi-colons in there. Is that a habit from Java? Laughing
Those ; didn't mess up the program. Interesting... I suppose Turing uses those ; but doesn't require them?

Author:  Catalyst [ Tue Mar 16, 2004 7:05 pm ]
Post subject: 

turing seems not to care whether use traditional semi-colons or its system
for example this runs fine
code:

setscreen ("offscreenonly");var y, x := 0.0;colorback (black);cls; for t : 1 .. 36000 x := ((cos (t / 100)) * 100) + t / 100; y := ((sin (t / 100)) * 200) + t / 100;
drawdot (round (x), round (y), white); end for for decreasing t : 36000 .. 1
x := ((cos (t / 100)) * 100) + t / 100 + 360; y := ((sin (t / 100)) * 200) + 360 - (t / 100);
drawdot (round (x), round (y), white); end for View.Update;

Author:  recneps [ Tue Mar 16, 2004 9:09 pm ]
Post subject: 

That explains the setscreen Wink
setscreen("graphics:300;300;nobuttonbar;nocursor;offscreenonly")
is the same as
setscreen("graphics")
setscreen("300;300")
setscreen("nobuttonbar")
setscreen("nocursor")
setscreen("offscreenonly")


the list goes on. Very Happy

And Thats some cool effects homer, i still dont know what sin and cos are exactly.... oh well ill know by June in end of math ;D

Author:  SuperGenius [ Tue Mar 16, 2004 9:33 pm ]
Post subject: 

Very neat.

I also liked the one that looked like an eye. It reminded me of the Eye of Barad-Ur(sp?)... ie. Sauron's tower in lord of the rings

Author:  Homer_simpson [ Wed Mar 17, 2004 4:36 am ]
Post subject: 

Catalyst wrote:
turing seems not to care whether use traditional semi-colons or its system
for example this runs fine
code:

setscreen ("offscreenonly");var y, x := 0.0;colorback (black);cls; for t : 1 .. 36000 x := ((cos (t / 100)) * 100) + t / 100; y := ((sin (t / 100)) * 200) + t / 100;
drawdot (round (x), round (y), white); end for for decreasing t : 36000 .. 1
x := ((cos (t / 100)) * 100) + t / 100 + 360; y := ((sin (t / 100)) * 200) + 360 - (t / 100);
drawdot (round (x), round (y), white); end for View.Update;

lol...
yeah just use ; i dunno... i guess it's a force of habbit...

Author:  Mazer [ Wed Mar 17, 2004 8:13 am ]
Post subject: 

SuperGenius wrote:
Very neat.

I also liked the one that looked like an eye. It reminded me of the Eye of Barad-Ur(sp?)... ie. Sauron's tower in lord of the rings

I think it'd be Barad-dur. Something along the lines of 'tower of darkness' or some such evil. And yeah, I totally agree, that's just what I was thinking when I saw it.

Author:  Cervantes [ Wed Mar 17, 2004 9:14 am ]
Post subject: 

what's more is that, when you take the code that catalyst posted, and take iout the ;s it works fine too. You could probably condense short1's pac man into one line of code Laughing

Author:  Homer_simpson [ Thu Mar 18, 2004 3:12 am ]
Post subject: 

setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for i : 1 .. 399 by 2
for t : 1 .. 3600
x := (sin (t / 100) ** 1) * 200
y := (cos (t / 100) ** i) * 100
drawdot (round (x) + 320, round (y) + 200, 44 - ((i div 67) mod 6));
end for
end for
View.Update

makes it look like that eye thingy in lord of the rings =Þ

Author:  Mazer [ Thu Mar 18, 2004 10:04 am ]
Post subject: 

Look at these, I just stumbled upon lituus spirals the other day and I've been playing around with them... who would've imagined math could not suck?

Lituus spiral: r^2 = a^2 / theta

code:

setscreen ("graphics:max;max,nobuttonbar")
var a := 800
var spacing := 1

drawfillbox (0, 0, maxx, maxy, 0)
drawline (maxx div 2, 0, maxx div 2, maxy, 23)
drawline (0, maxy div 2, maxx, maxy div 2, 23)

for i : 1 .. 1080 by spacing
    drawline (maxx div 2 + round (a / sqrt (i) * cosd (i)), maxy div 2 + round (a / sqrt (i) * sind (i)),
        maxx div 2 + round (a / sqrt (i + spacing) * cosd (i + spacing)), maxy div 2 + round (a / sqrt (i + spacing) * sind (i + spacing)), 12)
    drawline (maxx div 2 - round (a / sqrt (i) * cosd (i)), maxy div 2 - round (a / sqrt (i) * sind (i)),
        maxx div 2 - round (a / sqrt (i + spacing) * cosd (i + spacing)), maxy div 2 - round (a / sqrt (i + spacing) * sind (i + spacing)), 12)
    drawline (maxx div 2 + round (a / sqrt (i) * sind (i)), maxy div 2 - round (a / sqrt (i) * cosd (i)),
        maxx div 2 + round (a / sqrt (i + spacing) * sind (i + spacing)), maxy div 2 - round (a / sqrt (i + spacing) * cosd (i + spacing)), 12)
    drawline (maxx div 2 - round (a / sqrt (i) * sind (i)), maxy div 2 + round (a / sqrt (i) * cosd (i)),
        maxx div 2 - round (a / sqrt (i + spacing) * sind (i + spacing)), maxy div 2 + round (a / sqrt (i + spacing) * cosd (i + spacing)), 12)
end for


And this one (takes a little while to run)
code:

setscreen ("graphics:max;max,nobuttonbar")
var spacing := 2
var clr : int

drawfillbox (0, 0, maxx, maxy, 7)
drawline (maxx div 2, 0, maxx div 2, maxy, 23)
drawline (0, maxy div 2, maxx, maxy div 2, 23)

for i : 0 .. 255
    RGB.SetColour (i, i / 255, i / 255, i * 4 / 5 / 255)
end for
for a : 1 .. 800 by 5
    for theta : 1 .. 540 by spacing
        clr := round (a * 255 / 1200)
        Draw.ThickLine (maxx div 2 + round (a / sqrt (theta) * cosd (theta)), maxy div 2 + round (a / sqrt (theta) * sind (theta)),
            maxx div 2 + round (a / sqrt (theta + spacing) * cosd (theta + spacing)), maxy div 2 + round (a / sqrt (theta + spacing) * sind (theta + spacing)), 2, clr)
        Draw.ThickLine (maxx div 2 - round (a / sqrt (theta) * cosd (theta)), maxy div 2 - round (a / sqrt (theta) * sind (theta)),
            maxx div 2 - round (a / sqrt (theta + spacing) * cosd (theta + spacing)), maxy div 2 - round (a / sqrt (theta + spacing) * sind (theta + spacing)), 2, clr)
        Draw.ThickLine (maxx div 2 + round (a / sqrt (theta) * sind (theta)), maxy div 2 - round (a / sqrt (theta) * cosd (theta)),
            maxx div 2 + round (a / sqrt (theta + spacing) * sind (theta + spacing)), maxy div 2 - round (a / sqrt (theta + spacing) * cosd (theta + spacing)), 2, clr)
        Draw.ThickLine (maxx div 2 - round (a / sqrt (theta) * sind (theta)), maxy div 2 + round (a / sqrt (theta) * cosd (theta)),
            maxx div 2 - round (a / sqrt (theta + spacing) * sind (theta + spacing)), maxy div 2 + round (a / sqrt (theta + spacing) * cosd (theta + spacing)), 2, clr)
    end for
end for

Author:  AsianSensation [ Thu Mar 18, 2004 10:39 am ]
Post subject: 

nice, very.

Author:  recneps [ Thu Mar 18, 2004 1:38 pm ]
Post subject: 

pretty cool stuff there mazer, i agree, who thought that math could be remotely cool? Very Happy

Author:  sport [ Thu Mar 18, 2004 7:09 pm ]
Post subject:  Bored

It seems like the best works come out as a result of being bored, so let's get bored.

Author:  recneps [ Thu Mar 18, 2004 9:07 pm ]
Post subject: 

I think you're on to something there. Like that maple leaf animation i made? I was bored. That inuyasha game i made? I was bored. Cmon people join in! (im not saying they were good progs, just saying i was bored, so i made em ;D)

Author:  Mazer [ Thu Mar 18, 2004 9:37 pm ]
Post subject: 

Evasive Maneuvers, I was damn bored. But that's enough thread hijacking...

Author:  Thuged_Out_G [ Fri Mar 19, 2004 2:21 am ]
Post subject: 

mazer, the lituus spirals you were speaking of. in your formula, it involved theta. ive heard that somewhere in math class lol, but what is it?

Author:  Mazer [ Fri Mar 19, 2004 7:39 am ]
Post subject: 

It's a Greek letter. People tend to use it in math to represent an angle.

Author:  SuperGenius [ Fri Mar 19, 2004 2:25 pm ]
Post subject: 

your spirals were interesting, especially the second one.
What I think would be crazy would be a graph based on a series of numbers that i heard about at a lecture of theoretical mathematics and physics.

The series of numbers:

1, 2, 3, 4, 5, 6....

it goes on and on, but the sum of the numbers is somehow equal to -1.
That's a bit beyond my brain to rationalize, and the lecture was full of things like this so I came out with a serious brain cramp.
And then I went to Dairy Queen.

Author:  the_short1 [ Sat Mar 20, 2004 6:50 pm ]
Post subject: 

wow... those are amazing (all of them.... i would recoment making them random colors for dots or just something other then white,.. cuz white and black SUCK! take a peak at turing color chart... and see all the nice colors theiur are... they realy brighten it up...... wow... taht spiral was amzing..., i had to let it run for a while while posting for it to finish on my slow comp....
Posted Image, might have been reduced in size. Click Image to view fullscreen.
. i cant wait till i get to apply Math concepts into progrmaming.... then i can make some nice stuff like zylums fireworks and his rain, grass, forest, rain , and waves....... hmm he does a lot with nature....cant wait till compsci gr11

Author:  apomb [ Sun Mar 21, 2004 9:29 pm ]
Post subject: 

to make these look even cooler, instead of putting offscreen, use nooffscreenonly! pretty cool ideas!


: