Texas Instruments TI-89 Tip List page 137

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

This program, scatterf(), draws this type of scatter plot.
scatterf(f,x,xl,xh,yl,yh,n)
Prgm
©("f(var)","var",xmin,xmax,ymin,ymax,its)
©Function scatterplot with random points
©13aug01 dburkett@infinet.com
local k,e
false→e
©Clear graph screen
clrgraph
clrdraw
plotsoff
fnoff
clrio
©Set x- & y-axis ranges
xl→xmin
xh→xmax
yl→ymin
yh→ymax
©Loop to plot the function points
for k,1,n
if getkey()≠0:exit
(xh-xl)*rand()+xl→xn
expr(f&"|"&x&"="&format(xn,"S12"))→yn
if yn<ymin or yn>ymax then
true→e
pxltext "range error",0,0
disp "Range error: "&string(yn)
else
pton xn,yn
endif
endfor
©Delete global variables
delvar xn,yn
©Display range errors on prgm I/O screen
if e:disp
EndPrgm
The input arguments are
f
The name of the function to plot, passed as a string.
x
The name of the independent variable, passed as a string.
xl
The x-axis minimum
xh
The x-axis maximum
yl
The y-axis minimum
yh
The y-axis maximum
n
The number of points to plot
4 - 17

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents