           -- TAN DRAWER --

|EepP                   |
|eepp.b3ta.org          |
|eeppeliteloop@gmail.com|

What the program does :

This program will trace the function of
your choice in a domain and image range
of your choice ; and then will trace the
tangent or the normal at the point you'll
graphically select.

Applys to :

 I made this prog for Ti-80 calcs. 

Line by line explanations :

First, the program will present itself,
then it will ask you :

	XMIN ? 

This means the domain minimum of the
graphic. The same thing applys to :

	XMAX ?

After entering some numbers there (to
define your domain range), you'll be 
asked :

	ZSQUARE ?
	1/0 ?

In this program, the answer '1' always
means 'YES' and '0' 'NO'. The last line
wants to know if you want the graphic
to be squared, like when you trace a 
normal graphic by entering values in the
Y1 input, and then do a ZSTANDARD view
followed by a ZSQUARE. Each 'pixel' is
squared in that view, so the function
'F(x) = x', by example, is a real dia-
gonal inclined at 45 degrees. If you
choose yes, skip the following line. If
you choose no, the program will ask you :

	YMIN ?
	YMAX ?

These values will then represent the
image range of your graphic. After enter-
ing these values, the program will ask
you :

	FUNCTION
	Y/X ?

Here comes the hard part. Here, you have
to enter the function you want to be
traced to then apply a tangent or a normal.
You have to enter it between quotes (ALPHA+
[+]), and will a single variable named 'X'.

	FUNCTION
	Y/X ? "0.2X^2+X-7"

After you press enter (don't forget the
last quote), you'll be asked :

	Y/T ?

Here, you have to enter the same thing you
entered the last line, with the quotes, but
by replacing all the variables 'X' by some
variables 'T'. Here's the same example as
the previous one, with the logical replacing :

	Y/T ? "0.2T^2+T-7"

You can access the T letter by (Alpha+[4]).
The following question will be if you want
to disable or not the axes (which are one
pixel big). Choose '0' for 'NO' and '1' for
'YES'.

	AXES OFF ?
	1/0 ?

Yeah, that last trick, if enabled, removes
a maxmimum of four pixel of you function,
don't worry. Then, the program will ask you :

	TAN OR NORM ?
	0:TAN
	1:NORM

	1/0 ?

Choosing '0' will give you a tangent when you
will select the X-coordinate point and '1'
a normal. A normal is the perpendicular line
off the tangent at a given point.

Finally, your function will appear on the
graphic and a cursor you can control with the
blue arrows on the calculator will determine
the X-coordinate point to trace the tangent
or the normal on.

After that, you'll be asked to redo a tangent
or a normal, and finally, if you choose no, to
clear the graphic or not. Then the program will
end :

	DONE.

Notes :

- If you enter a lower value in the 'XMAX' than
the 'XMIN', an error will follow. Same comment
for 'YMIN' and 'YMAX'.

- REALLY don't forget the quotes (quotation marks)
to define your 'Y/X' and 'Y/T' functions.

- REALLY don't forget to enter the same function,
except for the variables to be replaced, in the
'Y/T' and 'Y/X' fields.

- When the time comes to select a X-coordinate
point with your cursor, only the X-coordinate value
will be retained, no matter how high or low your
cursor is. You can raise the precision of your
selection by following the trace of your function.

- If you don't know why your program don't work, you
can always email me, or look at ticalc.org for info
if you're a newbie in programming. You should really
know some basics before copying this program in your
calculator, like 'CLRHOME' isn't actually written
by the action of pressing key after key these letters,
but by searching the term in the 'PRGM' menu.

----------------------------------------------------
----------------------------------------------------

PROGRAM:TANDRAW
:CLRHOME
:CLRDRAW
:
:DISP "TAN DRAW"
:DISP "--------"
:DISP ""
:DISP "BY EEPP"
:PAUSE
:CLRHOME
:DISP "DOMAIN ?"
:INPUT "XMIN ? ",XMIN
:INPUT "XMAX ? ",XMAX
:
:CLRHOME
:DISP "ZSQUARE ?"
:INPUT "1/0 ? ",G
:
:IF G=1:THEN
:(48/64)XMIN->YMIN
:(48/64)XMAX->YMAX
:ELSE
:INPUT "YMIN ? ",YMIN
:INPUT "YMAX ? ",YMAX
:END
:
:GOTO W
:
:LBL R
:
:(ABS ((XMAX)-(XMIN))/64)->M
:(ABS ((YMAX)-(YMIN))/48)->N
:
:FOR(K,XMIN,XMAX,M
:PT-OFF(K,0
:END
:FOR
:
:FOR(L,YMIN,YMAX,N
:PT-OFF(0,L
:END
:
:GOTO Q
:
:LBL W
:
:0->XSCL
:0->YSCL
:GRIDOFF
:FNON
:""->Y1
:""->Y2
:""->Y3
:""->Y4
:NORMAL
:RADIAN
:FUNC
:
:CLRHOME
:DISP "FUNCTION"
:INPUT "Y/x ? ",Y1
:INPUT "Y/T ? ",Y2
:FNOFF
:
:CLRHOME
:DISP "AXES OFF ?"
:INPUT "1/0 ? ",U
:
:DRAWF Y1
:
:LBL F
:
:IF U=1:THEN
:GOTO R:END
:
:LBL Q
:
:CLRHOME
:DISP "TAN OR NORM ?"
:DISP "0:TAN"
:DISP "1:NORM"
:INPUT "1/0 ? ",S
:
:INPUT
:X->T
:NDERIV(Y2,T,T)->P
:(-P^-1)->V
:
:IF S=1:THEN
:DRAWF ((v*X)+(Y2-(V*T)))
:ELSE
:DRAWF ((P*X)+(Y2-(P*T)))
:
:END
:
:DISPGRAPH
:PAUSE
:
:CLRHOME
:DISP "ANOTHER TAN ?"
:INPUT "1/0 ? ",C
:
:IF C=1:THEN
:GOTO Q
:ELSE:GOTO J
:END
:
:LBL J
:DISP "CLRDRAW ?"
:INPUT "1/0 ? ",S
:
:""->Y1
:""->Y2
:
:IF S=1:THEN
:CLRDRAW
:STOP
:ELSE
:STOP
:END
:

----------------------------------------------------
----------------------------------------------------

Huh ? What else can you do with 3072 pixels ?
Ti-80 rules.
