Well I have a lot of other threads, but those are program specific, so this one will cover all my projects that are not for contests, (and not calcopoly , since I have a thread for that)

So at the moment I am working on
1.Binary->Decimal->Hex converter
2.Optimizing reimunns sum program
3.Still trying to write a derivative program (Different approach now)

Downloads
The Five Pack of Math
Description:
Five years Plus of math programs bundled in one light weight, user friendly, program.
I think you should definitely produce a Related Rates program that lets the user input various parameters of the problem but also explains how it's going to go about solving the problem. I remember being quite confused indeed by related rates problems when I first learned them, so a program that showed me some solutions and how it approached each particular problem would have been very helpful towards furthering my understanding.
OK, as of right now I am making it very graphical. For example.


Code:

1. .
   |   .
   |      .6.
4. |        .
   |__________ .
2.      5.  3.

For the triangle program this will be showed. The user presses 1. to input that angle, which will then have an option of static or dynamic. Then, you input the value. Input zero for what you dont know, and it will solve for everything unknown. Later on, I will have it solve for only what you need, but that will take some time I think. I will do the same thing with sphere, cylinder, square etc. then have a user inputed custom, and for that. They have to find the derivatives and all that themselves (or use my derivative program once it is finished) And input all the values. That also will not have step by step help since It is a bit different for each equation.

What do you think?

Edit: Drawing pictures in a code box is hard, The spacing is all weird. Very Happy
OK I have am having some problems with some code. Here is what I have so far. My new menu system for sub menus.


Code:

PROGRAM:RELATEDRAT
:ClrDraw
:0->Xmin:0->Ymin
94->Xmax:-62->Ymin
AxesOff:FnOff
1->theta
Text(0,5,"WHAT SHAPE ARE YOU USING
Text(6,5,"TRAINGLE/LINE
Text(12,5,"SPHERE
Text(18,5,"RECTANGLE/SQUARE
Text(24,0,"PLACE HOLDER
Text(30,0,"PLACE HOLDER
Text(36,0,"PLACE HOLDER
Text(42,0,"PLACE HOLDER
Text(48,0,"PLACE HOLDER
Text(54,0,"PLACE HOLDER
Repeat K=105
Repeat Ans
getKey->K
End
Text(6theta,0,"___ //3 spaces
theta+(K=34)-(K=25)+9(theta=1)-9(theta=10)->theta
Text(6theta,0,"->    //that is an arrow
End
End

While using this code I get domain errors when I reach the bottom so I change the theta=10 to theta=9 and that errors when I reach the top, wrap to the bottom, then move up one more , that is a data type error, another domain error when I am moving down the line, wrap to the top then move one off of the top row.

if you would like I can post a screenshot later.
OK thanks to Weregoose that problem is all fixed. So now to the actual problems of coding. haha. More to come later.
Ok so I am currently working on the inputting of related rates, and finding out it may not work the way I need it to.. Working with static and dynamic values and all... So here is my code thus far.


Code:

PROGRAM:RELATEDRAT
Repeat 0
:ClrDraw
:0->Xmin:0->Ymin
94->Xmax:-62->Ymin
AxesOff:FnOff
1->theta
Text(0,5,"WHAT SHAPE ARE YOU USING
Text(6,5,"TRAINGLE/LINE
Text(12,5,"SPHERE
Text(18,5,"RECTANGLE/SQUARE
Text(24,0,"PLACE HOLDER
Text(30,0,"PLACE HOLDER
Text(36,0,"PLACE HOLDER
Text(42,0,"PLACE HOLDER
Text(48,0,"PLACE HOLDER
Text(54,0,"PLACE HOLDER
Repeat K=105
Repeat Ans
getKey->K
End
Text(6theta,0,"___ //3 spaces
theta+(K=34)-(K=25)->theta
8(theta=1)-8(theta=10)->theta
Text(6theta,0,"->    //that is an arrow
End
If theta=1
For(U,0,1
ClrDraw
ClrHome
If Not(U
Then
Disp "INPUT","DYNAMIC DATA"," ","USE ZERO","FOR UNKNOWN
Pause "VALUES
Text(0,0,"DYANMIC
Else
Disp "INPUT","STATIC DATA"," ","USE ZERO","FOR UNKNOWN
Pause "VALUES
Text(0,0,"STATIC
End
Line(10,-45,10,-10
Line(45,-45,10,-10
Line(10,-45,45,-45
//1-3 are the sides of the triangles
//4-6 and angles where 4 is opposite side 1, 2 opposite 5 etc.
Text(25,3,"1.
Text(46,25,"2.
Text(22,30,"3.
Text(16,12,"4.
Text(37,12,"5.
Text(38,33,"6.
Text(6,20,"DOES NOT HAVE TO BE A
Text(12,27,"RIGHT TRIANGLE
//These only apply to 3d objects.
Text(18,40,"7.DEPTH
Text(24,45,"8.SURFACE AREA
Text(30,50,"9.AREA
Text(36,55,"0.VOLUME
Text(48,0,"PRESS NUMBER TO INPUT DATA
Text(54,0,"PRESS [ENTER] TO END
Repeat K=105
Repeat Ans
getKey->K
End
ClrHome
if not(U
If K=92
Input "HEIGHT",H
If K=93
Input "BASE/WIDTH",B
If K=94
Input "HYPOTENUSE ",C
If K=95
//etc for all inputs.
//then do the same with statics, with different variables.
End

Each would be put into the derivative equation.. Then tied together using Law Of Sines. TO keep things simple and for pure laziness and me not wanting to code a right triangle and a non right triangle version
So I dont really think this will work quite well... I am not sure yet. I _DO_ know, that this should be able to be way more optimized than this. but that will come later.
OK a deviation from Ti Basic and into Batch. I am making a macro for a friend of mine. well, altering a macro. Hey has a macro program that takes mouse clicks, and does them in a certain recorded order. But, there is only an option of infinite number, or a certain number. He wants it to be done for a time, like when he leaves for work, sleeps etc. So I was thinking have it set to loop 1 time, and have a his macro program run a .bat file with that macro set to run inside, and loop until a certain key combo is pressed. I was thinking something like this.. But I am not sure how to set it up.


Code:

ECHO OFF
SET Choice=
:Top
If %Choice% = F10 ;the desired keypress
GOTO End
Start Macro.mcs ;the macro File
GOTO Top
:End
Exit


Would this work? I am a little sketchy just trying it since the last time I messed with this (in the macro Program) I had problems with an infinite loop.. Which froze my pc and required a hard shut down (Which I _Hate_ Doing)
Batch programs cannot freeze your computer. The worst they can do is "freeze" the current cmd window by not letting you type in a new command, and a simple ctrl-c will terminate your batch script. I'm not sure if macros can freeze a command window, but again, the Windows process model (and the *nix process model too) says that no single livelocked/deadlocked process should be able livelock/deadlock the entire OS, within reason.
Well the other program that I used to run the macro . (the one my friend has) Was stuck in an infinite loop with the macro calling itself each time... So that is why. I think. and it was not so much frozen. as, since each macro was going 10 times. My mouse could not move.. and my Task manager was being clicked so much that I could not kill the program..

Edit: I will test it and see. Hopefully it works, this "friend" is a pest...
So after spending an hour figuring out why it would not work. I have decided to say screw it, I am making my own macro in visual basic. I think it will be MUCH Easier. If I have time tomorrow I will work on it and post some code.
*Epic Bump*

OK so I gave up Calculator Programming for awhile, and well. Now that we are doing integrals in Calculus, I know how to program those without having programs take hours for a few lines... >Sad, I am still trying to figure out my derivative program without looking through strings to find Cos Sin etc and replacing them. But that is for another time. For now I have rewritten my reimunns sum program. I am using for loops and have almost cut it down to 1/4 the size. (That will be refilled once I graph the partitions and the graph, Which I will probably need help with)

OK so without ado.. Here is my new code.


Code:

:ClrDraw
:Text(1,1,"WHAT SHAPE ARE YOU USING
:Text(7,1,"1.SQUARE
:Text(13,1,"2.TRIANGLE
:Text(19,1,"3.CIRCLES
:Repeat Ans
:getKey
:End
//This whole area will eventually be sprite controlled, I will use an Arrow moving up and down to control the selections.
:If Ans=92
:1→Z
:If Ans=93
:sqrt(3)/4→Z
:If Ans=94
:π/8→Z
:ClrHome
:Input "HEIGHT FORMULA",Str1
:String►Equ(Str1,{Y1}
:Input "LOWER BOUND FORMULA",Str2
:String►Equ(Str2,{Y2})
:Input "LEFT BOUND",P
:Input "RIGHT BOUND",Q
:abs(Q-P→L
:Input "NUMBER OF PARTITION",N
:(L/N)→V
For(B,0,1
:0→X:0→C
:For(M,C,L-V,V
:X+V→X
:(ZV)(({Y1}-{Y2})){^2}→U
If not(U
:U+T→T
If U
U+S->S
:End
:Disp "RIGHT EDGE SUM":Pause T
End
:Disp "LEFT EDGE SUM
:Pause S
:Disp "TOTAL VOLUME
:Pause :(T+S)/2→K
:End


This should be all good.. I retyped the code by hand off of some old code, so it should be close. I also found a few optimizations I need to make in my real conde on calc. Now.... I figure out the graphical side of things.

Code:
:If Ans=92
:1→Z
:If Ans=93
:sqrt(3)/4→Z
:If Ans=94
:π/8→Z
Works, but only because of a fluke. It should really be:
Code:
(Ans=92)+sqrt(3)(Ans=93)/4+π(Ans=94)/8→Z
Same thing with
Code:
If not(U
:U+T→T
If U
U+S->S
, because the first U update might make the second one run. I think it should be more like:
Code:
:If U:Then
:U+S->S
:Else
:U+T->T
:End
Ok. I think everything works good as it is now. haha. And why does that first one only work because of a fluke? ..

Also, I am making a Binary to Decimal Converter for my VB.NET Class. (In TI Basic)

Dont have it all the way made yet, but I was thinking something like this..


Code:

0-> Dim(L1

Disp "INPUT FROM RIGHT TO LEFT","[+] TO ADD TERMS","[ENTER] WHEN DONE
Repeat K=105
getKey->K
If K=95
Then
Input "NEXT TERM",Z
Z->L1(1+Dim(L1
End
End
For(U,0,Dim(L1
If L1(U
T+2^U->T
End
Disp "DECIMAL NUMBER
Pause T

The Decimal to binary will be a bit more tricky, but not too much.. The worst will be Hexadecimal to Bin/Dec and vice versa.

Also how does that code look? Might need some obvious optimiziations.

EDIT:Changed HEX to Hexadecimal
We were only criticizing having it all in capitals, as HEX. It's not an abbreviation, like Hyper Excellent Xray or something, it's an abbreviation, Hex, like Dec or Bin or Oct. Also, let me challenge you to turn that into a general base A to base B converter, which isn't as hard of a challenge as you might expect.
OK. By Base A to Base B Converter, do you mean any base 10? EG. Meter etc?

If so I could probably do that too, really easily.

(Also sorry about the Hex, I see your point)
Base A to base B means convert any base 2 through 36 (for example) to any other base 2 through 36. Hint: It's easier to think about if you build a base A - to - base 10 converter first, then a base 10 - to - base B converter.
Yea that is what I was doing with binary to hex. Convert it to Decimal first, then hex from there..

(I am really tired and not thinking straight, but that sounds harder than Decimal->Binary->Hex.)

What would you need that is 36 base? Binary is base 2. Hex is base 16.. Or is that just a fun project?
Bump:

So an update on my works. My Integral Program is going quite well. My reimunns sum solves
2 dimensional Planes using squares\Rectangles.
I am working on a trapezoidal sum right now.

3 dimensional using
Squares
Spheres
triangles

Also, It draws the graph with all of the said partitions (only 2D of course) and it also solves, left sum, right sum, and mid point.

And it is STILL 500 Bytes smaller than my competitors program.

And the other program only has, trapezioidal sums, Left right, mid point sums. And it draws it a little better than mine.

His is 1500 bytes. and uses A LOT of bad programming styles, such as labels, Quote and parenethesis endings.

I stared at the code of the other program for 30 minutes for a hint into drawing the graphs, All I got was a headache and a loath for his code. Very Happy
I really need help With this program
It is reimunns sum (Sp). Using trapazoidal estimation, Rectangle estimation, in both 2D and 3D. Circle and triangle in 3D. My right edge sum (2D Mode) IS way wacky. Getting severall hundred thousand times higher than the correct answer, Comments in the program say where all that is, and what all I need help with.


Code:

:Repeat 0
:Normal:a+bi:AxesOff:ClrDraw
:Text(0,0,"WHAT SHAPE ARE YOU USING?
:Text(6,10,"TWO DIMENSIONAL
:TExt(12,0,"SQUARE
:Text(18,0,"2.TRAPAZOID
:Text(30,10,"THREE DIMENSIONAL
:Text(36,0,"3.SQUARE
:Text(42,0,"4.CIRCLE
:Text(48,0,"5.TRIANGLE
:Text(54,0,"6.EXIT
:Repeat J
:getKey->J
:End
:If J=92
:.5->Z
:If J= 93
:1->G
:If J=94
:1->Z
:If J=83
:sqrt(3)/4->Z
:If J=82
:pi/8->Z
:ClrHome
:Input "TOP EQUATION",Str1
:String->Equ(Str1,Y1
:ClrHome
:Input "BOTTOM EQUATION",Str2
:String->Equ(Str2,Y2
:ClrHome
:Repeat Ymax>Ymin
:Input "LOWER BOUND Ymin",Ymin
:Input "UPPER BOUND Ymax",Ymax
:If Ymin<=Ymax:Then
:Disp "Ymin CANNOT BE >=","Ymax"
:Rand(90
:End
:End
:Repeat Xmax>Xmin
:Input "LEFT BOUND Xmin",Xmin
:Input "RIGHT BOUND Xmax",Xmax
:If Xmin>= Xmax:Then
:Disp "Xmin CANNOT BE >=","Xmax"
:rand(90
:End
:End
:abs(Xmin-Xmax->L
:Input "NUMBER OF PARTITIONS",N
:L/N->V
://V== partiton size
:If J=93:Then
:1->U
:For(X,Xmin,Xmax,V
://Change X from Xmin to Xmax, incrementing by the partion size
:ZV(2(X!=Xmin and X!=Xmax)(Y1-Y2)->L1(1+dim(L1
:If U=1
:Then
:L1(U)->T
:Else
:T+L1(U)+L1(U-1)->T
://not sure if this is right, this is supposed to be a trapazoidal
://sum estimation. Need Help with that one
:End
:U+1->U
:End
:Pause T
:End
:For(U,0,1,.5
://////////////////////////////////////////
://increments from 0, to .5 to 1
://For some reason my right edge sum is about 300Thousand bigger than it should be
://Right edge sum is found when U==1
://///////////////////////////////////////
:For(X,Xmin+VU,Xmax-VU,V
:0->theta
:if not(D:Then
:(VZ)(Y1-Y2)^2->theta
:Else
:V(Y1-Y2)->Theta
:End
://If D= any number, then we are finding a 3 dimensional sum
://if D=0 then We are finding a 2D Sum.
://I may end up making 2 separate loops for that. Going for speed here, not really size much
://so I would love your opinion on what is faster
:If not(U
:theta+L->L
:If U=.5
:theta+M->M
:if U=1
:theta+R->R
:End:End
:///////////////////////////////////////
://Displays just used for testing purposes. These will be removed in the
://final program
:///////////////////////////////////////
:Disp L,R
:Pause M
://///////////////////////////////////////////
://Somehow my Right Edge Sum "R" When U=1. Ends up several hundred thousand bigger
://than left and midpoint sums. Left and midpoint are correct. U=0, U=>5 respectively
://I cant find why this is..
://////////////////////////////////////////////
://Below here will show the graph of the functions and the partitions
://i had this working when my right edge sum worked. But here is the code anyway
://Speed optimizations welcomed
://////////////////////////////////////////////
:FnOff
:Text(0,40,"GRAPH
:Text(6,0,"1.LEFT EDGE SUM
:Text(12,0,"2.MID POINT SUM
:Text(18,0,"3.RIGHT EDGE SUM
:Text(24,0,"4.NONE
:Repeat J
:getKey->J
:End
:If J=82:Then
:Disp "LEFT EDGE SUM
:Pause L
:Disp "MID POINT SUM
:Pause M
:Disp "RIGHT EDGE SUM
:Pause R
:End
:AxesOn:FnOn
:If J=93:Then
:For(X,Xmin+V,Xmax,V
:Line(X,Y2,X,Y1
://///////////////////////////////////////////////////
://Draws a line between Y1 (Top Equation) And Y2(Bottom Equation) 
://At every partition
://working on drawing the top of the "Rectangle" now. 
://////////////////////////////////////////////////////
:End
:Text(0,0,Str1,"AND",Str2,"FROM",Xmin,"TO",Xmax
:Text(12,0,"RIGHT EDGE SUM,R
:Pause :End
:If J=92:Then
:For(X,XMin,Xmax,V
:Line(X,Y2,X,Y1
:End
:Text(0,0,Str1,"AND",Str2,"FROM",Xmin,"TO",Xmax
:Text(12,0,"LEFT EDGE SUM",L
:Pause :End
:If J=94:Then
:For(X,Xmin+(V/2),Xmax,V
:Line(X,Y2,X,Y1
:End
:Text(0,0,Str1,"AND",Str2,"FROM",Xmin,"TO",Xmax
:Text(12,0,"MIDPOINT SUM",M
:Pause :End


Thanks in advance for the help

Exactly where the problem part is


Code:

For(U,0,1,.5
:For(X,Xmin+VU,Xmax-VU,V
:0->theta
:if not(D:Then
:(VZ)(Y1-Y2)^2->theta
:Else
:V(Y1-Y2)->Theta
:End
://If D= any number, then we are finding a 3 dimensional sum
://if D=0 then We are finding a 2D Sum.
://I may end up making 2 separate loops for that. Going for speed here, not really size much
://so I would love your opinion on what is faster
:If not(U
:theta+L->L
:If U=.5
:theta+M->M
:if U=1
:theta+R->R
:End:End



Assume Y1 and Y2 are already inputed. You are finding the space between Xmin and Xmax.

Y1 is top equation
Y2 is bottom equation.
V is partition Size found from abs(Xmax-Xmin)/Number of partitons

Should be all you really need to know.


Left Edge (U==0) and Midpoint (U==.5) Come out fine. Right edge (U==1) Has major problems. The number is at least 100K Bigger than it should be. I am sure it is something small I am overlooking.

Thanks weregoose. again
EDIT: I Forgot to add that I have a program that runs at the front, that cleans up any problems. IT delvars all functions, and registers. And all variables. So no problems there.
Bump.

Can anyone help me out here? I am wracking my brains to get this working right.

NOTE TO SELF::

Where I am so far
http://pastebin.com/9kxfSRcV
  
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 2
» 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