All the math is correct but it's not displaying anything beetween the first and last point...


Code:
BEZIAR
60→A               These are the points for the bezium curve... whats generating it
A→B
A→F
A+30→C
A+40→D
A+60→E
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
For(T,0,10
θ=0 and Y=1 SO QθX=Q0X                      \\ all of this is finding out where the points are
A+(C-A)*(T/10)→QθX                           
B+(D-B)*(T/10)→QθY
C+(E-C)*(T/10)→QYX
D+(F-D)*(T/10)→QYY
QθX+(QYX-QθX)*(T/10)→BX
QθY+(QYY-QθY)*(T/10)→BY
det(59,DOT,BX,BY       \\ this is the thing displaying the points inside of the for loop
End
Pause
det(1



Btw you might have to be really smart to help
Jcsq6 wrote:
All the math is correct but it's not displaying anything beetween the first and last point...


Code:
BEZIAR
60→A
A→B
A→F
A+30→C
A+40→D
A+60→E
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
For(T,0,10
θ=0 and Y=1 SO QθX=Q0X
A+(C-A)*(T/10)→QθX
B+(D-B)*(T/10)→QθY
C+(E-C)*(T/10)→QYX
D+(F-D)*(T/10)→QYY
QθX+(QYX-QθX)*(T/10)→BX
QθY+(QYY-QθY)*(T/10)→BY
det(59,DOT,BX,BY
End
Pause
det(1



Code:
BEZIAR
60→A→B→F
will store 60 to A, B, and F
30→C+10→D+20→E
will store 30 to C, 40 to D, and 60 to E
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
For(T,0,100,10
θ=0 and Y=1 SO QθX=Q0X
A+((C-A)*T)/100→QθX
due to ICE's inability to work with decimals/floats of any kind, you will need to divide last, so that you don't get the same value every time, because 1/10=2/10 in ICE. Only 10/10>0 ;)
B+((D-B)*T)/100→QθY
C+((E-C)*T)/100→QYX
D+((F-D)*T)/100→QYY
QθX+((QYX-QθX)*T)/100→BX
QθY+((QYY-QθY)*T)/100→BY
det(59,DOT,BX,BY
End
Pause
det(1

Or do this for better speed (unless ICE doesn't have an optimization for dividing by 256)

Code:
BEZIAR
60→A→B→F+30→C+10→D+20→E
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
For(T,0,256,16
will display 16 instead of 10
θ=0 and Y=1 SO QθX=Q0X
A+((C-A)*T)/100→QθX
B+((D-B)*T)/256→QθY
C+((E-C)*T)/256→QYX
D+((F-D)*T)/256→QYY
QθX+((QYX-QθX)*T)/256→BX
QθY+((QYY-QθY)*T)/256→BY
det(59,DOT,BX,BY
End
Pause
det(1
Why did you divide by 256? also why did you do for(t, 0, 256, 16
And why did you divide by 100 one time and 256 the others? I understand the Idea of putting off the divison till the end, but could you explain the rest of the code? Not to kick a gift horse in the mouth or anything....
Jcsq6 wrote:
Why did you divide by 256? also why did you do for(t, 0, 256, 16
And why did you divide by 100 one time and 256 the others? I understand the Idea of putting off the divison till the end, but could you explain the rest of the code? Not to kick a gift horse in the mouth or anything....


256 is well optimized, due to it basically just cutting off the lowest byte and moving the others down. 256 is the number of combonations in one byte.
100 was the one I used first, before Runer112 (an Asm expert) informed me of this. Also it makes the most sense in a base-10 system (humans have 10 fingers and 10 toes; if we had 16, our number system would count up to F (which is 15 in base-10) before becoming 10 (which is 16 in base-10)
16²=256, so two digits of base-16 (hexadecimal) is one byte; whereas in base-10 (decimal), the closest you could get to expressing 256 is with 4 digits (1000).
"For(T,0,256,16" starts T at 0, then adds 16 until it is equal to or greater than 256. I decided on this due not only to the above reasoning, but also to that the way you had your loop; from there it made sense.
Don't worry about 'kicking a gift horse in the mouth'. Knowledge is more important here Wink (in my opinion at least)
The problem is that when, Say, Pt1-the point at the center of the curve- gets to high or to low... then the calc crashes... same with P2 and P0 I have no Idea why


Code:
BEZIAR
0→PYON
0→PZON           \\these three variables indicate what points on the curve are moving
0→PθON
   P0=(A,B) P0=(140,120)     P1=(C,D) P1=(160,100)     P2=(E,F) P2=(180,80)
P0=(A,B)
140→A
120→B
P1=(C,D)               \\These are comments telling me which variables go to which points
160→C
100→D
P2=(E,F)
180→E
80→F
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
det(9,1
Repeat K=15
getKey→K
det(5,255
If K=49
1→PYON
0→PZON
0→PθON
End
If K=50
0→PYON
1→PZON
0→PθON
End
C+(K=3)*(PYON=1)-(K=2)*(PYON=1)→C
D+(K=1)*(PYON=1)-(K=4)*(PYON=1)*(D>0)→D
E+(K=3)*(PZON=1)-(K=2)*(PZON=1)→E
F+(K=1)*(PZON=1)-(K=4)*(PZON=1)→F
If PYON=1
det(18,"P1 POSITION?",200,100
Output(5,13,D
End
If PZON=1
det(18,"P2 POSITION?",200,100
Output(5,13,E
End
DISPLAY CURVE
For(T,0,256,16
A+((C-A)*T)/100→QθX
B+((D-B)*T)/256→QθY
C+((E-C)*T)/256→QYX
D+((F-D)*T)/256→QYY
QθX+((QYX-QθX)*T)/256→BX
QθY+((QYY-QθY)*T)/256→BY
det(59,DOT,BX,BY
End
det(10
End
det(1
Jcsq6 wrote:
The problem is that when, Say, Pt1-the point at the center of the curve- gets to high or to low... then the calc crashes... same with P2 and P0 I have no Idea why


Code:
BEZIAR
0→PYON
0→PZON           \\these three variables indicate what points on the curve are moving
0→PθON
   P0=(A,B) P0=(140,120)     P1=(C,D) P1=(160,100)     P2=(E,F) P2=(180,80)
P0=(A,B)
140→A
120→B
P1=(C,D)               \\These are comments telling me which variables go to which points
160→C
100→D
P2=(E,F)
180→E
80→F
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
det(9,1
Repeat K=15
getKey→K
det(5,255
If K=49
1→PYON
0→PZON
0→PθON
End
If K=50
0→PYON
1→PZON
0→PθON
End
C+(K=3)*(PYON=1)-(K=2)*(PYON=1)→C
D+(K=1)*(PYON=1)-(K=4)*(PYON=1)*(D>0)→D
E+(K=3)*(PZON=1)-(K=2)*(PZON=1)→E
F+(K=1)*(PZON=1)-(K=4)*(PZON=1)→F
If PYON=1
det(18,"P1 POSITION?",200,100
Output(5,13,D
End
If PZON=1
det(18,"P2 POSITION?",200,100
Output(5,13,E
End
DISPLAY CURVE
For(T,0,256,16
A+((C-A)*T)/100→QθX
B+((D-B)*T)/256→QθY
C+((E-C)*T)/256→QYX
D+((F-D)*T)/256→QYY
QθX+((QYX-QθX)*T)/256→BX
QθY+((QYY-QθY)*T)/256→BY
det(59,DOT,BX,BY
End
det(10
End
det(1


You are trying to use a homescreen command after "det(0".
Use this instead

Code:

det(19,X,Y
det(15,N,digits_to_display
beckadamtheinventor wrote:
Jcsq6 wrote:
The problem is that when, Say, Pt1-the point at the center of the curve- gets to high or to low... then the calc crashes... same with P2 and P0 I have no Idea why


Code:
BEZIAR
0→PYON
0→PZON           \\these three variables indicate what points on the curve are moving
0→PθON
   P0=(A,B) P0=(140,120)     P1=(C,D) P1=(160,100)     P2=(E,F) P2=(180,80)
P0=(A,B)
140→A
120→B
P1=(C,D)               \\These are comments telling me which variables go to which points
160→C
100→D
P2=(E,F)
180→E
80→F
minY5,5,"07070707070707070707070707070707070707070707070707"→DOT
det(0
det(9,1
Repeat K=15
getKey→K
det(5,255
If K=49
1→PYON
0→PZON
0→PθON
End
If K=50
0→PYON
1→PZON
0→PθON
End
C+(K=3)*(PYON=1)-(K=2)*(PYON=1)→C
D+(K=1)*(PYON=1)-(K=4)*(PYON=1)*(D>0)→D
E+(K=3)*(PZON=1)-(K=2)*(PZON=1)→E
F+(K=1)*(PZON=1)-(K=4)*(PZON=1)→F
If PYON=1
det(18,"P1 POSITION?",200,100
Output(5,13,D
End
If PZON=1
det(18,"P2 POSITION?",200,100
Output(5,13,E
End
DISPLAY CURVE
For(T,0,256,16
A+((C-A)*T)/100→QθX
B+((D-B)*T)/256→QθY
C+((E-C)*T)/256→QYX
D+((F-D)*T)/256→QYY
QθX+((QYX-QθX)*T)/256→BX
QθY+((QYY-QθY)*T)/256→BY
det(59,DOT,BX,BY
End
det(10
End
det(1


You are trying to use a homescreen command after "det(0".
Use this instead

Code:

det(19,X,Y
det(15,N,digits_to_display



which command? the output command? I just put that because in ICE I dont know how to output a value on the screen
Jcsq6 wrote:

which command? the output command? I just put that because in ICE I dont know how to output a value on the screen

You can't use Output after "det(0" that is what's causing the crash Wink
so like I said, use this in place of Output

Code:

det(19,X,Y //X,Y is where you want to display the number, in pixels. X,Y not Row,Collumn
det(15,N,3 //you change 3, up to 8, and down to one; I just used it here for simplicity
beckadamtheinventor wrote:
Jcsq6 wrote:

which command? the output command? I just put that because in ICE I dont know how to output a value on the screen

You can't use Output after "det(0" that is what's causing the crash Wink
so like I said, use this in place of Output

Code:

det(19,X,Y //X,Y is where you want to display the number, in pixels. X,Y not Row,Collumn
det(15,N,3 //you change 3, up to 8, and down to one; I just used it here for simplicity


I took out the output command (since that was just a command telling me the value of the variable. I needed to know the variable value to isolate the cause of the crash... but I still have no idea. and its still crashing
Also If your'e sesting this in an emulator you edit P1 and P2 by pressing Graph and trace
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement