So a couple years ago when I was taking Algebra 1, I made a nifty little program for some simple linear graph line functions.

Namely, it would find the slope of a line given two points and it could find the midpoint of a line (given the endpoints of course), and find the endpoint of a line given the midpoint/other endpoint.

So I'm taking Algebra II this year, and I'm finding the program has limitations. Ergo, I went to revamp some things and ended up rewriting most of the program so it has a lot better interface. Same functions and whatnot.

But it's extremely limited. I want to make the program into a filler-inner. Fex, you could give it two points of a line, and it would retrieve slope, X-intercept, Y-intercept and an equation for the line (Y = mx + b), which could then be stored to one of the equation variables.

The goal of the (new) program is thus: Find the x-intercept, y-intercept, slope and equation from any 2 of the aforementioned variables (or substitute X/Y intercept with two arbitrary points on the line).

This is where it gets incredibly ugly.
Getting x-int, y-int, equation and slope from two points is fine and dandy. But I want it to be able to do more. Like you'd give it two points and it could fill in the rest of the information, or you could give it one point and the slope, or the X-intercept and the Y-intercept, or the X-intercept and the slope, and et cetera.

This is made somewhat simpler by the fact that X-int and Y-int are essentially the same as any two given points on the line, and more useful at that.

However, I have little idea about how to do this without epic (even legendary) amounts of hard-to-navigate Menu cruft and assorted annoyances (like the time I tried to do the same thing with right triangles a while back; my skills were reflected in the 58% I got on the subsequent test).

Right now I've got a vague idea of what to do (which is probably going to be completely redone). X1, Y1, X2, Y2, slope1 and slope2 would be set to some unlikely number (perhaps 1.23456). A couple Menus would provide input for X1, Y1, X2, Y2 and slope, and a "GO" key. Whichever of these differed from 1.23456 would determine where the program went next. If no slope was given, it would use the points to get a slope numerator and denominator. Whichever way it went, it would use the given variables to determine the Y-int and X-int (this would be skipped if the points provided were already the x/y intercept). And from then, it would determine what the equation would be, display all the variables and give an option to store the equation to one of the Y= variables.

Somehow I don't feel too confident about this... at all.
It sounds to me like your problem is more of an interface issue than actually deriving the solution.

First of all, from a user-perspective view, tons of menus isnt exactly enticing... try making your own input interface which lets you "skip over" certain items, and input everything the user knows. Then, find the appropriate equation to solve for the unknowns...
rthprog wrote:
It sounds to me like your problem is more of an interface issue than actually deriving the solution.

First of all, from a user-perspective view, tons of menus isnt exactly enticing... try making your own input interface which lets you "skip over" certain items, and input everything the user knows. Then, find the appropriate equation to solve for the unknowns...


What I've got so far is thus:

It sets X1, Y1, X2, Y2, S1 and S2 to 1.23456.
Then there's a menu where you can input the coordinates for point 1/point 2 as well as the slope. You can also reset any of these things from another menu (which will reset them to 1.23456).

Next up is deciding which formulas to execute first based on which variables are entered and which are left blank (i.e. 1.23456).

I'm pretty busy with stuff lately, but I'll see what I can do about finishing the program.
Cool =D

I wrote up a simple GUI you might want to try

Code:
:"X1Y1X2Y2S1S2"-->Str0
:0-->dim(L1)
:6-->dim(L1)
:L1-->L2
:1-->B
:While 1
:ClrHome
:For(N,1,dim(L1)
:Output(N+1,2,sub(STr0,2N-1,2)+"=
:If L2(N)
:Then
:Output(N=1,5,L1(N
:Else
:Output(N+1,5,"?
:End
:End
:dim(L1)-->Z
:DelVar A
:While A <> 105
:Output(B+1,1,">
:0:Repeat Ans : GetKey : End : Ans --> A
:Output(B+1,1," "
:(A=34)-(A=25)+B-->B
:Z(B=0)-Z(B=Z+1)+B-->B
:End
:Output(B+1,1,"*
:For(N,1,7
:Disp ""
:End
:Input "=",A
:ClrHome
:A-->L1(B)
:1-->L2(B)
:End


1.) again, <> is "not equal to"
2.) the above program is simply a GUI to selectively input variables, which are stored to L1. If nothing is stored to the variable, the identical location in L2 will be "0", if otherwise, "1
3.) could you post up what you have already? ; I would love to see what you have done Cool
Here's an optimized version of rthprog's code:


Code:
:"X1Y1X2Y2S1S2-->Str0
:Delvar L16-->dim(L1
:L1-->L2
:1-->B
:While 1
:ClrHome
:For(N,1,dim(L1
:Output(N+1,2,sub(Str0,2N-1,2)+"=
:If L2(N
:Then
:Output(N=1,5,L1(N
:Else
:Output(N+1,5,"?
:End
:End
:dim(L1-->Z
:DelVar A
:While A <> 105
:Output(B+1,1,">
:Repeat Ans:GetKey:End
:Output(B+1,1," "
:B+(Ans=34)-(Ans=25-->B
:B+Z(B=0)-Z(B=Z+1-->B
:End
:Output(B+1,1,"*
:For(N,1,7
:Disp "
:End
:Input "=",A
:ClrHome
:A-->L1(B
:1-->L2(B
:End
but Kerm... won't the lack of a "0" before the repeat cause the getkey to simply be skipped since B is still stored to Ans?

haha I just realized that
1.) the ClrHome after the input is redundant, and
2.) moving the "dim(L1-->Z" to right before the "While 1", and using Z in place of "dim(L1)" could save a byte. Then again you could just use 6 if you're that space-concious...
rthprog wrote:
but Kerm... won't the lack of a "0" before the repeat cause the getkey to simply be skipped since B is still stored to Ans?
. No, because a Repeat loop always executes at least once. While executes at least zero times.

rthprog wrote:
haha I just realized that
1.) the ClrHome after the input is redundant, and
2.) moving the "dim(L1-->Z" to right before the "While 1", and using Z in place of "dim(L1)" could save a byte. Then again you could just use 6 if you're that space-concious...
Yeah, why are you using dim(L1 all the time instead of 6?
rthprog wrote:
Cool =D

I wrote up a simple GUI you might want to try

Code:
:"X1Y1X2Y2S1S2"-->Str0
:0-->dim(L1)
:6-->dim(L1)
:L1-->L2
:1-->B
:While 1
:ClrHome
:For(N,1,dim(L1)
:Output(N+1,2,sub(STr0,2N-1,2)+"=
:If L2(N)
:Then
:Output(N=1,5,L1(N
:Else
:Output(N+1,5,"?
:End
:End
:dim(L1)-->Z
:DelVar A
:While A <> 105
:Output(B+1,1,">
:0:Repeat Ans : GetKey : End : Ans --> A
:Output(B+1,1," "
:(A=34)-(A=25)+B-->B
:Z(B=0)-Z(B=Z+1)+B-->B
:End
:Output(B+1,1,"*
:For(N,1,7
:Disp ""
:End
:Input "=",A
:ClrHome
:A-->L1(B)
:1-->L2(B)
:End


1.) again, <> is "not equal to"
2.) the above program is simply a GUI to selectively input variables, which are stored to L1. If nothing is stored to the variable, the identical location in L2 will be "0", if otherwise, "1
3.) could you post up what you have already? ; I would love to see what you have done Cool


Meh. I haven't been able to do much work on it recently, but I'll see what I can do; I'm also going to submit Line Chaser (the optimized version) to the archive along with screenshots/documentation soon.
  
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