" <-APL2-------------------- sam293.txt ---------------------------->
Lex 'tangr'
Gz tangr a;b;c;d;e;f;g;h;k;m;n;p;s;t;u;v;w;x;y
"Graphs the imaginary coefficient of tan.
"Call format:
"z = 0 if header information to be generated, 1 otherwise.
" b = Imaginary coefficient of argument.
" | c = Number of points to generate.
" | | f = length of y axis.
" | | | g = length of x axis.
" | | | |
" V V V V
"z tangr 1,300,6,20
(b c f g)#a
e#f%2 " midpoint vertically of graph.
k#(_g%2)+gX(-1+Ic+1)%c
h#(k+g%2),',',[1.5]y#e+u#11O3O(bX0j1)+k
m#I-1+g " Integer points on x axis.
n#m_g%2 " Values to display at integer points on x.
s#I-1+f " Integer points on y axis.
t#s_e " Values to display at integer points on y.
$dataXIz
'\setlength{\unitlength}{',(F4.5%g),'in}'
'\begin{picture}(',(Fg),',',(Ff),')'
'%Draw a frame around the picture'
' \put(0,0){\line(1,0){',(Fg),'}}' " bottom horizontal
' \put(0,0){\line(0,1){',(Ff),'}}' " left vertical
' \put(0,',(Ff),'){\line(1,0){',(Fg),'}}' " top horizontal
' \put(',(Fg),',0){\line(0,1){',(Ff),'}}' " right vertical
'%Draw the x axis'
' \put(0,',(Fe),'){\line(1,0){',(Fg),'}}' " horizontal x axis
(`Z' \put('),((m,[1.5]','),e),`Z'){\circle*{.05}}'
(`Z' \put('),(-.1+m+-.5Xn<0),',',(e_.5),(`Z'){$'),n,[1.5]`Z'$}'
'%Draw the y axis'
(`Z' \put(0,'),s,[1.5]`Z'){\circle*{.05}}'
(`Z' \put(.05,'),s,(`Z'){$'),t,[1.5]`Z'$}'
data:'%Label the curve'
v#1Y(u=S/u#|u)/k " x coord where maximum/mininum occurs
w#(v=k)/y " y coord of maximum/minimum
'\put(',(Fv+g%2),',',(Fw+(.075Xb>0)_.5Xb<0),'){n\#',(Fb),'}'
'%Draw the data points'
(`Z'\put('),h,`Z'){\circle*{.04}}'
G
0 tangr 1,300,6,20
1 tangr .5,300,6,20
1 tangr -1,300,6,20
1 tangr -.5,300,6,20
)off