Welcome to Eyes on FF!
>>> Click here to download Final Fantasy Ringtones
Oh no!
 

Post New Thread  Reply
 
LinkBack Thread Tools
blackmage_nuke
That's me!!
blackmage_nuke's Avatar
Location: Yes
#1
Default Software designers Qbasic + mathemeticians polynomial graphs

So im writing this program for class that draws polynomial graphs using q basic. And i cant find the whats wrong with my program.
It works with Parabolas and Cubics curves, but for some reason when it gets to polynomials of degree 4, it draws the graph but there are these weird lines that appear on the sides.

This is the code

Code:
CLS
SCREEN 1
SCREEN 0

INPUT "What is the highest power of x?", power
FOR z% = 0 TO (power)
PRINT "what is the pronumeral of x^"; z%
INPUT pronum(z%)
NEXT

SCREEN 1
LINE (160, 0)-(160, 200)
LINE (0, 100)-(320, 100)
FOR i% = -30 TO 30
y = 0
y2 = 0
FOR z% = 0 TO (power)
y = (pronum(z%) * (i%) ^ (z%)) + y
y2 = (pronum(z%) * (i% + 1) ^ (z%)) + y2
NEXT
y = -y
y2 = -y2
posx = (i% * 6) + 160
posy = y + 100
posx2 = ((i% + 1) * 6) + 160
posy2 = y2 + 100
LINE ((posx), (posy))-((posx2), (posy2))
NEXT
Can anyone tell me how to get rid of those lines or atleast whats causing them?

I could be wrong but I think it might be that the values get too high or something and the program cant handle it and just goes to a really high value or something, if thats the case can someone tell me the maximum value?

Otherwise it could be some crazy maths concept ive never heard about

edit: I just realised pronumeral should be co-eficcient so dont point that out to me

Last edited by blackmage_nuke; 09-19-2007 at 01:14 PM.
Old 09-19-2007, 12:58 PM
Reply With Quote
blackmage_nuke is online now  
Post New Thread  Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:08 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0
Copyright ©2000 - 2007, Eyes on Final Fantasy.
Sean Robinson Design