Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Need help with parabola-drawing
Author Message
Entz

Posted: 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.

Tony

Posted: Wed Dec 03, 2003 10:26 pm   Post subject: (No subject)

showing your code would help with questions like that, so that someone can point out where you're having problems
Tony's programming blog. DWITE - a programming contest.
Homer_simpson

Posted: Wed Dec 03, 2003 10:39 pm   Post subject: (No subject)

 code: View.Set ("offscreenonly") var yy, y := 0 var a, b, c := 0.0 a := .001 b := 0 c := 50 for x : -320 .. 320     y := round (a * ((x + b) ** 2) + c)     for xx : -320 .. 320         yy := round (a * ((xx + b) ** 2) + c)         drawdot (xx + 320, yy, 9)     end for     drawfilloval (x + 320, y, 10, 10, 9)     View.Update     delay (10)     cls end for
Entz

Posted: Wed Dec 03, 2003 11:47 pm   Post subject: (No 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.
Tony

Posted: Thu Dec 04, 2003 10:07 am   Post subject: (No 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
Tony's programming blog. DWITE - a programming contest.
Entz

Posted: Thu Dec 04, 2003 4:49 pm   Post subject: (No 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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 6 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: