ATAR Notes: Forum
VCE Stuff => VCE Mathematics => VCE Mathematics/Science/Technology => VCE Subjects + Help => VCE Specialist Mathematics => Topic started by: /0 on December 21, 2008, 02:50:55 am
-
Inspired by shinny in the other thread on calculators, I've decided to have a go at programming myself
Here's a program to find scalar and vector resolutes. It works but is still quite primitive:
Vector 1 is ai+bj+ck
Vector 2 is di+ej+fk
p = scalar resolute in direction of second vector
q = vector resolute etcetcetc.
r = scalar resolute perpendicular to second vector
s = vector resolute etcetcetc.
res(
Prgm
Prompt a,b,c
Prompt d,e,f
(a*d+b*e+c*f)/(√(d^2+e^2+f^2)) → p
Disp p
(a*d+b*e+c*f)/(d^2+e^2+f^2)*(d*i+e*j+f*k) → q
Disp q
√(a^2+b^2+c^2-p^2) → r
Disp r
a*i+b*j+c*k-q → s
Disp s
EndPrgm
There are several improvements I need help with though:
- Is there a way to input values in the Home screen, for example: " res(a,b,c ; d,e,f) " ?
- Is there a way to display the answer on the Home screen? Preferably in a matrix like:
Row 1: [scalar, vector]
Row 2: [perpendicular scalar, perpendicular vector]
- Is there a way to clear all the variables after the program has run? (I mean like a "clear a-z", but integrated into the code)
(btw all these should be possible, a friend did it but didn't reveal the code lol)
So... anyone here pro with the calculator? :P
-
For vectors, ALWAYS use matrices. For example, i+2j+3k is [1,2,3] in the homescreen. Don't forget that the 89 has a built in dotP( function (obviously dot product) so make use of that. To simplify your further programming, define other things first such as a unit vector function which you can use to program other things. I'd copy down the code I used except I have a severe lack of AAA's to power up my 89 with (mum stole them IMMEDIATELY after I finished VCE; go asianness).
-
So using matrices, you'll get something like: 'res([a,b,c],[d,e,f])', but remember that you just code this as 'res(a,b)' as the matrice is treated as a number by itself in a way. However, rather than integrating all your vector functions into one program, I just defined a series of functions instead and used each individually as required as it's quite unlikely you'll ever need all of those in one hit, and it'll be too unmanagable if you did. The ones which I had were:
1. uv(a) (produces the unit vector of a)
2. sr(a,b) (scalar resolute of a in b)
3. vr(a,b) (vector resolute of a in b)
4. mag(a) (magnitude of vector a)
5. va(a,b) (angle between vectors a and b)
6. pr(a,b) (vector resolute of a perpendicular to b)
and I think that's all I had. However, if you want to finish what you already had going, try asking Mao for some help with programming since this really isn't my area.
-
lol thanks shinny, I didn't even know TI-89 had vector functions!
I'll keep going with this diabolical plan, but if it the calculator takes too long then I might split it up into smaller functions as you suggested. :P
-
I've actually written a program to do this, however it would appear now to be superfluous if all those functions shinny said actually existed :P
if it doesn't work, find me on msn, i can help you with the syntax =]
-
nono, the ones I said above I programmed myself. The only native function is dotP(. Sorry for making that unclear.
-
ahhh =]
i demand sauce :P
-
Anyone know how to keep something exactly the way you input it?
i.e. I want output to read
after I input that exact same thing...
But it reads as:
, very annoying.
thanks
(loci program, this is gonna be big)
-
I've made a code for finding the general equation of an ellipse. Unfortunately, it is rather useless at the moment, since you will have to already know that the form you are dealing with is an ellipse! I am working on branching this code out to include the main loci, then it should be EPIC. Since the equation may appear unfactored (grrr), I have included the solutions for a^2,b^2,h,k in
. The "Output" commands were ****** up so I had to mess around with them to get them right, they might work differently on another calculator. Also, the program is 507 (kb, b, kB?), so it could use some tidying up.
OH yeah, and a BIG THING to note is that you have to solve your expression = 0, then put it in, i.e.:

You type:
(~4 seconds to evaluate)
loci()
Prgm
ClrIO
Input "Input Expression",q
x+y*i→z
zeros(d(q,x),x)→list4
list4[1]→j
zeros(q|x=j,y)→list4
1/2*abs(list4[1]-list4[2])→a
1/2*(list4[1]+list4[2])→k
zeros(q|y=k,x)→list4
1/2*abs(list4[1]-list4[2])→b
ClrIO
Disp "Input Expression"
Disp q
If a=b Then
Disp "Circle"
Else
Disp "Ellipse"
EndIf
Disp (x-j)^2/a^2+(y-k)^2/b^2=1
Pause
Output 76,1,"h="
Output 64,26,j
Output 63,75,"k="
Output 63,97,k
Pause
Output 80,1,"a^2="
Output 63,35,a^2
Output 65,76,"b^2="
Output 63,111,b^2
EndPrgm
The program works by identifying the coordinates of the stationary points of the ellipse (since that is the only way I know to do it). It then uses this information to find the rest of the values. The planned program will require extensive use of stationary points:
0 stat points => Left-right Hyperbola, Line, Inverse parabola
1 stat points => Parabola
2 stat points => Ellipse, Up-down Hyperbola
My current dilemma is in trying to find a way for the calc to recognise the # of solutions, and furthermore to recognise the type of locus required. Comments and advice would be appreciated :)
EDIT: Code for y=ax^2+bx+c parabola:
para()
Prgm
Input "Input Expression",q
zeros(d(q,x),x)→h
zeros(q|x=h,y)→t
t→k
{}→t
zeros(q|y=k-1,x)→t
If t={} Then
zeros(q|y=k-1,x)→t
t[1]→r
t[2]→s
zeros(a*(x-r)*(x-s)-y|x=h and y=1,a)→a
Disp expand(y=a*(x-r)*(x-s)+k-1)
Else
t[1]→r
t[2]→s
zeros(a*(x-r)*(x-s)-y|x=h and y=-1,a)→a
Disp expand(y=a*(x-r)(x-s)+k+1)
EndIf
EndPrgm
Once again, solve equal to 0, then type the expression, e.g.:
or
-
Kudos on trying, but i still do not understand what these programs actually do :P
but, 507 is quite small for a program, so it's not that bad. I've written quite a few 2k+ ones, though I have come to realise they were absolutely useless :P
however, may i suggest the 'nsolve' function for solving rather devious algebraic equations for numerical values, it is a LOT faster.
-
Kudos on trying, but i still do not understand what these programs actually do :P
but, 507 is quite small for a program, so it's not that bad. I've written quite a few 2k+ ones, though I have come to realise they were absolutely useless :P
however, may i suggest the 'nsolve' function for solving rather devious algebraic equations for numerical values, it is a LOT faster.
Lol yeah, sorry it isn't very clear, basically my aim is to be able to solve a question like:
Find the locus of the point P such the sum of distances from P to (0,2) and from P to (8,2) is 20. (Extension to complex loci is easy)
So you would set up the equation as ^2}+\sqrt{(x-8)^2+(y-2)^2} = 20)
Then you solve ^2}+\sqrt{(x-8)^2+(y-2)^2} -20=0)
Then you type in: ^2}+\sqrt{(x-8)^2+(y-2)^2} -20)
And out pops:
Ellipse
^2}{84}+\frac{(y-2)^2}{100}=1)


(In reality the output is actually
... that's why I give the values for h,k,a^2,b^2. aiyah!)
-
riiight, that makes sense, and nicely done!
however, I have never seen a question like that. so... :P
-
Loci isn't even on the Specialist course I thought?
-
Loci isn't even on the Specialist course I thought?
I thought that also, though loci over C is in the course.
-
Loci isn't even on the Specialist course I thought?
I thought that also, though loci over C is in the course.
Oh... didn't know that. Is loci over C a common question?
-
generally there's at least one in either exams. You'll learn those towards the end of complex numbers.