Re: defining functions with the values of variables (not the


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

Re: defining functions with the values of variables (not the actualvariables)



  I came across this problem while also working on a conic section program. But my problem was that after the user had given the program the type of conic section, rotation angle, etc. and I then when to graph it, I had long expressions in y1(x) and y2(x). These expressions were then being recalculated from scratch for every value of x making for some long graphing times. 
  All of my attempts and making the calculator define y1(x) and y2(x) with numerical values for the coefficients failed. So I ended up just storing all the coefficients into variables, and then used the variables in defining the functions. This sped up the graphing considerably.

Sorry I couldn't be of more help,
Scott Rickman




****************************************
hi all.
i'm writing a program for my ti89 that takes an expression, tries to find out if
it's an equation in x and y for a conic section. If so, it identifies it,
calculates and displays various parameters (eccentricity, foci, etc.), displays
equations in cartesian and parametric form, and stores parametric equations in
xt3(t) and yt3(t), so that after the program exits, i can just press [diamond] +
F3 to see the conic plotted (much neater than trying to get an implicit plot).

now, the problem is this:
suppose that i've been given the equation for a circle, and i determine that the
circle's center is at (1,1), and that its radius is 4.
While calculating this, i store the radius in a variable called rad, and the
center coordinates in the variables hh and kk.

The parametric equations should be:
xt3(t)=1+4*cos(t)
and
yt3(t)=1+4*sin(t)

However, when i store the equations using
Define xt3(t)=hh+rad*cos(t)
and
Define yt3(t)=kk+rad*sin(t)

The equations in the Y= editor are stored as exactly that (i.e. hh+rad*cos(t))
instead of the equations with the actual values of hh, kk, and rad (which would
make the equation x expression 1+4*cos(t)).

This is ok, so long as  the variables are not local. But it makes it harder to
follow the equations, and it leads to a lot of silly little variables littering
up the ti (since i can't make them local).

Is there any way to define these parametric functions such that they contain the
_values_ stored in hh, kk, and rad? I guess i could whip up some ugly string
conversion-concatenation-conversion kludge, but i'm hoping there's some easier
way...

thanks...:)


===== ===  ==   =    = ====  = = = == = = =  = = ==   = = =
...from the aspiring geek, the $al-Man
(AKA NineTurningMirrors, AKA ByteChild)
alien-angel@the-pentagon.com - smoke_jaguar@email.com
ICQ #: 58895095  -  http://members.nbci.com/ZeroMaster/
====== = = = ====== = ===== = === == =
Do you realize how many holes there could be if people would just take the time
to take the dirt out of them?

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************