home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
calculat
/
sm30a.zip
/
SYMBMATH.H49
< prev
next >
Wrap
Text File
|
1993-11-07
|
2KB
|
48 lines
5.2. Plotting y = f(x)
You can plot a function of y = f(x) on the xy-plane by a single
external function
plot(f(x),x)
plot(f(x),x,xmin,xmax)
plot(f(x),x,xmin,xmax,ymin,ymax)
f(x) can be either a function with bound variable x or an expression
involving x. For example, you could graph the parabola with the command
plot(x^2,x).
The xmin and xmax are range of x-axis, the ymin and ymax are range of
y-axis. The default values are xmin=-5, xmax=5, ymin=-5, and ymax=5.
The values of xmin, xmax, ymin, ymax are real numbers, such that
xmin < xmax and ymin < ymax. Thses values tell SymbMath that the
visible screen corresponds to a portion of the xy-plane with
xmin <= x <= xmax and ymin <= y <= ymax.
The operator plot() plots one point (x,f(x)) for each pixel on the
x-axis, and connects successive points. To omit the connections and just
plot the points, use the command:
dotplot(f(x),x)
To plot only every 20th point, which is useful for rapidly
graphing complicated functions, use
sketch(f(x),x)
If you want your circles and squares to look correct --
that is, if you want one vertical unit to be really the same
distance as one horizontal unit--you should select window
parameters so that the horizontal axis is 1.4 times as long as
the vertical axis.
Example 5.2:
plot a function of x^3.
IN: plot(x^3,x)
5.3 Plotting r = f(t) in polar coordinates
You can graph the portion of a polar curve r = f(t) that lies in
the window with a single external function:
polar(f(t),t)
polar(r, t,tmin,tmax)
polar(r, t,tmin,tmax,rmin,rmax)
f(t) can be a function with bound variable t or an expression involving t.
For example, to graph the cardoid r = 1+cos(t), execute the command
polar(1+cos(t),t)
The variable t covers the domain (0, 2π); you can change this default by
specifying a range for t:
polar(1+cos(t), t,0,pi)