Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 drawparabola
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
octopi




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
this_guy




PostPosted: Wed Jun 09, 2004 8:22 pm   Post subject: wut's a parabola?

as my title says, wuts a parabola?
octopi




PostPosted: Wed Jun 09, 2004 8:23 pm   Post subject: (No subject)

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




PostPosted: Wed Jun 09, 2004 8:24 pm   Post subject: (No subject)

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




PostPosted: Wed Jun 09, 2004 8:30 pm   Post subject: (No 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!



parabola.zip
 Description:

Download
 Filename:  parabola.zip
 Filesize:  527 Bytes
 Downloaded:  229 Time(s)

Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: