Computer Science Canada

drawparabola

Author:  octopi [ Wed Jun 09, 2004 8:15 pm ]
Post subject:  drawparabola

hey again....

I made a drawparabola command

code:
procedure drawparabola (x:int,y:int,xlen:int,ylen:int,col:int)
  var xn,yn:real
  for t:1..10000
    xn:=0.5*xlen* sin (t)+x
    yn:=0.5*ylen* cos (2*t)+y-round(0.5*ylen)
    drawdot(round(xn),round(yn),col)
  end for
end drawparabola

drawparabola(100,100,50,60,45)
drawbox(99,99,101,101,54)       
drawbox(75,40,125,40,78)
drawbox(75,40,75,100,78)



Okay, information about this, as the box's which are really lines, but I'm to lazy to change it shows.......xlen is the horizontal length of the parabola at its widest point. ylen is the maximum height of the parabola, x,y is the vertex.


I don't technically know for sure that its a parabola, but it looks like one...and meh

Author:  this_guy [ Wed Jun 09, 2004 8:22 pm ]
Post subject:  wut's a parabola?

as my title says, wuts a parabola?

Author:  octopi [ Wed Jun 09, 2004 8:23 pm ]
Post subject: 

....its what you get when you run my program, or what you learn in grade 10 math....

Author:  this_guy [ Wed Jun 09, 2004 8:24 pm ]
Post subject: 

...
...oh rite!!!
i'm in grade 9...lol
dont mind me i'm just bored

Author:  the_short1 [ Wed Jun 09, 2004 8:30 pm ]
Post subject: 

ehy.... good stuff!!!

me like... very handy...


here i made it into a unit so u can just put this file with ur program, then u dont have to include that proc in ur prog!



to draw a parabola



import drawparabola
drawparabola.draw (parameters)


just THAT ez!


: