Senior_Lark_Lark
Joined: 21 Jan 2009 Posts: 1
|
Posted: January 21, 2009 10:32 PM Post subject: TI-89 Programming Help |
|
|
Ok I have been programming on the TI-83 and the TI-84 since 7th grade and I was fairly good at it. However, I just bought the TI-89 Titanium and was trying to make a simple Program to calculate the Four Forms of a line and I am having a little trouble. Here is my Code
| Code: | :fourform()
:Prgm
:ClrIO
:Disp "four forms of a line"
:Disp "press enter"
:Pause
:ClrIO
:Disp "where to..."
:Disp "1.point slope form"
:Disp "2.slope-intercept form"
:Disp "3. standard form"
:Disp "4.intercepts form"
:Disp "5. all forms"
:Pause
:Prompt z
:If z=1 Then
:Goto u
:Lbl u
:ClrIO
:Disp "enter points"
:Disp "(x1,y1)(x2,y2)
:Prompt a,b,c,d
:ClrIO
:Disp "m= (y2-y1)/(x2-x1)"
:Disp "a=x1 b=y1 c=x2 d=y2"
:(d-b)/(c-a)->m
:Disp "slope=",m
:Disp "write that down"
:Pause
:ClrIO
:Disp "1.point-slope form"
:Disp "y-y1=m(x-x1)"
|
the end is where I am stuck. I want to take that equation and with the points prompted (a,b,c,d) and substitute those into the equation and actually get the point slope form of the line. Would I use a function? What do I do to do that and then Display the answer in point slope form. So if the points are (-2,-7)(5,3) the answer would be displayed as
y-3= (10/7)(x-5) thus substituting m=10/7 x1=5 y1=3.
I have done this before with the TI-83 and TI-84 using the text commands but have no clue how to do that on the TI-89.
This program is not for me it is for my roommate who is horrible at math. |
|
Boom
Joined: 09 Feb 2009 Posts: 2
|
Posted: February 9, 2009 4:23 PM Post subject: :Disp "y-y1=m(x-x1)" |
|
|
ok to fix that you have to put each varible as its own string. you can add strings together with a '&' symbul between them, you can also tell the it89 to treat a number as a string with the 'string(' comand.
so to get what you are looking for replace :Disp "y-y1=m(x-x1)" with
:Disp "Y-"&string(b)&"="&string(m)&"(X-"&string(a)&")"
'string(' can be found by pressing [2nd]->[5]->[D]->[1]
'&' can be found by pressing [2nd]->[+]->[3]->[6]
also you could restore the numbers as strings to cut down the lenght of the Disp comand like so:
:string(a)->a
:string(b)->b
:string(m)->m
:Disp "Y-"&b&"="&m&"(X-"&a&")"
hope this helps, goodluck on future programing projects. |
|