0 Members and 2 Guests are viewing this topic.
Code: [Select].AAClrDraw47->X5->Y0->VRect(0, 60, 96, 4)For(A, 0, 200)DispGraphV-9.8->VY+V->YPxl-On(X,Y)PauseIf Y+2V>60-V->VEndEnd
.AAClrDraw47->X5->Y0->VRect(0, 60, 96, 4)For(A, 0, 200)DispGraphV-9.8->VY+V->YPxl-On(X,Y)PauseIf Y+2V>60-V->VEndEnd
What you can do is "inflate" the value to get more accuracy. 256 is a great number since it's very optimized in both division and multiplication. Since Axe variables hold 16-bit numbers, you can use the lower byte as the decimal and the higher byte as the number. 9.8 can be represented by 9 + 205/256. You get your inflated number by multiplying by 256 so that's 9*256 + 205 = 2509 == 9.8 as an inflated decimal. You can treat this number like any other number. If you add 1 to it, you're really adding 1/256th and adding 256 is like adding 1, etc. When it comes time to display the point, just divide by 256 so that you recover the integer part for the pixel. So you're doing math with the precision of 1/256th and then just drawing it to the nearest pixel.
While 1256*X+U->X256*Y+V->YPt-On(X/256, Y/256, Pic1)End
While 1X+U→XY+V→YPt-On(X/256, Y/256, Pic1)End
.INPUTClrHomeinput->ADisp A,i //The i is the imaginary i for newlineRepeat getKeyEnd