Author |
Message |
Tubs
|
Posted: Mon Mar 17, 2003 11:58 am Post subject: Graphing calculator |
|
|
alright this graphing calculator works for declaring a point, it puts it whereever i say. BUT whenever i put a slope it draws multiple dots... (and i know it is possible to work cause my friend got it)
whats wrong?
Description: |
|
Download |
Filename: |
graphing calc.t |
Filesize: |
6.62 KB |
Downloaded: |
536 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
|
|
|
|
Tubs
|
Posted: Mon Mar 17, 2003 12:24 pm Post subject: (No subject) |
|
|
hahaha you noticed that did you
anyways k i will try that gimme 1 sec
|
|
|
|
|
|
Tubs
|
Posted: Mon Mar 17, 2003 12:27 pm Post subject: (No subject) |
|
|
alright it makes the line, but its still all made of dots. how do i make it connected if thats possible? well i know its possible but im really tired lol
AND it messes up my graphing thing. ex, 10 x value and 10 y doesnt go up 1 square
|
|
|
|
|
|
Tony
|
Posted: Mon Mar 17, 2003 12:53 pm Post subject: (No subject) |
|
|
to make dots connected, you ether
a) have to draw more dots. Such as instead of looping 1,2,3 try looping 1.5,2,2.5,3, etc.
you can use only integers in forloop, so use a normal loop instead. OR
b) draw your graph using lines. Such as instead of drawing a dot, draw a line from previous dot to current dot. You'd have to keep track of the last dot drawn.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Big_Tom
|
Posted: Tue Mar 18, 2003 11:59 am Post subject: (No subject) |
|
|
yes i also need help with this project. I can't get the line to graph correctly i did the same line thing that you told tubs and i still can not get it to work correctly. This slope is correct but the cordinate values are wrong and i dont know how to fix it.
|
|
|
|
|
|
Asok
|
Posted: Tue Mar 18, 2003 12:01 pm Post subject: (No subject) |
|
|
this is because turing coordinates work differently then graphing coordinates. in graphing the orgin (0,0) is in the center. in turing the origin is in the bottom left corner. This is probably why your coordinates are off.
|
|
|
|
|
|
Tubs
|
Posted: Tue Mar 18, 2003 12:12 pm Post subject: (No subject) |
|
|
actually no, the program has its own coordinate system
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Asok
|
Posted: Tue Mar 18, 2003 12:18 pm Post subject: (No subject) |
|
|
Nevermind what I said then
|
|
|
|
|
|
Tubs
|
Posted: Tue Mar 18, 2003 12:28 pm Post subject: (No subject) |
|
|
its aight, and i got it to work for you who were wondering
code: |
Graph
for I : -midx .. midx
Z := round (M * (I - X) + Y)
drawfilloval (midx + I, Z + midy , 2, 2, 12)
end for | [/code]
|
|
|
|
|
|
Big_Tom
|
Posted: Tue Mar 18, 2003 12:56 pm Post subject: (No subject) |
|
|
I want to know how to make the line an actual line not just composed of ovals. It would clean it up a little bit more.
|
|
|
|
|
|
Tubs
|
Posted: Tue Mar 18, 2003 12:59 pm Post subject: (No subject) |
|
|
ya that would be nice lol but...
i need to know how to declare an array, then use it in a for statement. its for putting coordinates across the graph. ex, array 1..10 is -50 .. 50 then i use the for statement to put them on the screen by a certain amount
|
|
|
|
|
|
Tony
|
|
|
|
|
Tubs
|
Posted: Wed Mar 19, 2003 12:51 pm Post subject: (No subject) |
|
|
for I : 0 .. maxx by 10
for J : -50 .. 50 by 10
Draw.Text (J, I, midy, fontID, white)
end for
end for
this is supposed to draw -50 .. 50 at midy, why doesnt it work? all the vars are declared *i think* can you put the vars and the correct draw command please?
|
|
|
|
|
|
Asok
|
Posted: Wed Mar 19, 2003 1:00 pm Post subject: (No subject) |
|
|
fontID has not been declared.
|
|
|
|
|
|
|