PDA

View Full Version : [Calc] Distance Slope and Midpoint finder



WMD54
10-12-2008, 11:11 PM
This is a very, very useful program that I wrote and it has saved me a whole lot of time. You enter two coordinate points and it finds the slope of the line that passes in between the two points, the distance between the two points and the midpoint of the line in between the two points. Here's the source and the program is attached on the bottom. DO NOT COPY AND PASTE THE SOURCE INTO A NEW PROGRAM THERE ARE SYMBOLS IN THE PROGRAM THAT ARE NOT SUPPORTED ON A BROWSER SO I HAVE HAD TO CHANGE SOME STUFF. see what you can figure out, and anything you don't get, ask me.

:"Distance, slope and midpoint
ClrHome
SetUpEditor LDSM
Archive LDSM
UnArchive LDSM
If dim(LDSM)=1
Then
Goto 2
End
Disp "Welcome to DSM,","the distance,","slope, and","midpoint finding","program."
For(A,1,2000)
End
Output(8,1," By: WMD54")
For(A,1,1000)
End
ClrHome
Lbl 2
1->LDSM(1)
Disp "To quit, enter","all zeros."
For(A,1,500)
End
ClrHome
0->A:0->B:0->C:0->D:0->E:0->F:0->G:0->H:0->I:0->J
Lbl 1
Disp "A=x,B=y,C=x‚","D=y‚"
Prompt (A)
Prompt (B)
Prompt (C)
Prompt (D)
If A=0 and B=0 and C=0 and D=0
Then
Goto N
End
sqrt((C-A)(squared)+(D-B)(squared))->I
(D-B)/(C-A)->E
(D+B)/2->F
(C+A)/2->G
Disp "Distance:"
Output(7,11,I)
Disp "Slope:"
Output(7,8,E)
Disp "Midpoint:"
Output(8,1,"( , )")
Output(8,2,G)
Output(8,9,F)
Pause
ClrHome
Goto 1
Lbl N
ClrHome
Output(4,1," Bye! ")
For(A,1,500)
End
ClrHome
Stop

SonniE
10-12-2008, 11:16 PM
coolio coulda used this in geometry last year

WMD54
10-12-2008, 11:20 PM
this stuff just keeps popping up. i'm in pre-cal and i've used it this year so you never know when you'll need it

xWhite_Shadowx
10-12-2008, 11:31 PM
u still do a review of it in Alg 2 sonnie