Re: TIB: Need help with math prog I am writing


[Prev][Next][Index][Thread]

Re: TIB: Need help with math prog I am writing



I am, if you haven't looked at the source yet it is below your original
message.
and those funny characters are either a store to () or convert to.(Đ)

>Hmmmm, I wrote a GREAT vector Program (at least I thought so...) a few years
>ago, and as long as you're working with 2d vectors (3d, you'd have to use
>your aproach) I believe you are overlooking a great feature of the 86 (and
>85)----COMPLEX NUMBERS!!!   They can be input as rectangular [ (1,2)=1+2i ]
>or polar (look in the manual).  There also exist functions to retrieve either
>the x/y (real and imag) parts, or the radius and angle (not sure, check
>manual, long time since I did this).  This simplifies your program so MUCH!
>To find distance, subtract the two, and take the absolute value of the radius
>of the result (polar-rectangular conversion on the fly, and you don't have to
>mess with trig fucntions!)  Plus, you can output in polar or rectangular, etc
>etc etc.  Although I've never used vectors really on the 85 (what I've got) I
>found complex numbers an easy way to represent vectors.....especially to add
>and subtract them too.  Of course, vectors may be the better solution, I
>don't know, but if the complex numbers fit what you need, I highly recommend
>using them......

12JKL:12MNO:12XYZ
Lbl X
Menu(1,"Comp",B,2,"Point",C,3,"Motion",D,10,"Docs",F,4,"Equat",E
Lbl B
ClLCD
1MNO
Goto A
Lbl Y
0MNO
Outpt(4,1,"Components:"
Outpt(4,13,D
Goto X
Disp "Enter as [x,y]"
Input "First vector:",A
Input "Second vector:",B
(dot(A,B))/((abs A)*(abs B))C
Disp CĐDMS
motion
Lbl D
Lbl A
ClLCD
Input "Initial Pos:",A
Input "New Position:",B
If MNO==1 or XYZ==1
Goto Z
Input "Elapsed Time: ",T
Lbl Z
B-AD
If MNO==1
Goto Y
If XYZ==1
Goto W
Outpt(4,1,"Displacement:"
Outpt(4,14,D
D/TV
Outpt(5,1,"Velocity:"
Outpt(5,11,V
abs VABV
Outpt(6,1,"Speed:")
Outpt(6,8,ABV
Outpt(7,2,ABV”
Outpt(7,1,"ˆ"
Pause
Goto X
Lbl E
1XYZ
Goto A
Lbl W
0XYZ
Outpt(4,1,"DirectionVector:"
Outpt(4,17,D
Outpt(5,1,"Vector Equation:"
Outpt(6,1,"(x,y)=")
Outpt(6,7,A
Outpt(6,14,"+t"
Outpt(6,16,D
Pause
ClLCD
real AK
imag AJ
real BI
imag BH
Outpt(1,1,"Parametric Equations:"
Outpt(2,1,"x="
Outpt(2,3,K
If sign I==1
Outpt(2,6,"+"
If sign I==-1
Outpt(2,6,"-"
abs IAsin
Outpt(2,7,Asin
Outpt(2,10,"t"
Outpt(3,1,"y="
Outpt(3,3,J
If sign H==1
Outpt(3,6,"+"
If sign H==-1
Outpt(3,6,"-"
abs HABSI
Outpt(3,7,ABSI
Outpt(3,10,"t"
Outpt(4,1,"Rectangler Equation:"
K-IX1
J-HY1
Y1/X1X
Solver(J=K*X+Kk,Kk,0
Outpt(5,1,"y="
Fix 3
Outpt(5,3,X
Outpt(5,9,"x"
If sign Kk==1
Outpt(5,10,"+"
If sign Kk==-1
Outpt(5,10,"-"
abs KkABSK
Outpt(5,11,ABSK
Float
Pause
ClLCD
Disp "Coeff on x:"
Disp XĐFrac
Disp "b for mx+b"
Disp ABSKĐFrac



Goto X
---
I pledge allegiance to the Mac of Apple Computer Incorporated, and to the
developers for which it stands, one platform, under Jobs, indestructible,
with creativity and multimedia for all. 

References: