Computer Science Canada Need help with parabola-drawing |
Author: | Entz [ Wed Dec 03, 2003 10:17 pm ] |
Post subject: | Need help with parabola-drawing |
I need to draw a parabola or graph the movement of an object in Turing. I am having a bit of trouble as I can only draw 1 kind of parabola and it doesn't seem to want to be altered to the numbers specified. |
Author: | Tony [ Wed Dec 03, 2003 10:26 pm ] |
Post subject: | |
showing your code would help with questions like that, so that someone can point out where you're having problems ![]() |
Author: | Homer_simpson [ Wed Dec 03, 2003 10:39 pm ] | ||
Post subject: | |||
|
Author: | Entz [ Wed Dec 03, 2003 11:47 pm ] |
Post subject: | |
var setoff := 400 var y := 0 var a := 2 var b := 2 var c := 50 for x : -300 .. 300 y := round (a * (x + b) ** 2 + c) * -1 drawfilloval (x + 100, y + setoff, 1, 1, 5) end for ^^^ this is really what I had in mind and THX for your help Homer. its just that the value for setoff changes the size of my parabola. |
Author: | Tony [ Thu Dec 04, 2003 10:07 am ] |
Post subject: | |
you guys should find two points (well... one point and keep previous in another variable) and draw a line between two points instead. Then the graph would look like a complete curve, not a bunch of scatered dots ![]() |
Author: | Entz [ Thu Dec 04, 2003 4:49 pm ] |
Post subject: | |
THx that makes alot of scence. Finding one point at a time is so easy and plus it'll be more original than some stuff other people in my class will graph ![]() |