next up previous
Next: Solving Equations Exactly Up: COMMANDS FOR MATH Previous: Some Common Errors

Plotting Planar Curves

Planar curves are given in one of the three forms - explicitly as in (a parabola), implicitly as in (a circle), or in parametric form as in , (a cycloid). Curves may also be given in polar form as in the three leaved rose .

To draw two explicitly given curves and y=1-2x over the interval [0,1], use

plot( {x-x^2, 1-2*x}, x=0..1 );
To determine the point of intersection of the two curves in 0<x<1, left click the point of intersection to obtain its approximate location as . To kill the graph type q in the graph window.

To draw curves given in parametric form one still uses the plot command. e.g. to plot the cycloid , and the circle with center origin and radius 2 given in parametric form by use

plot( {[t+sin(t), 1-cos(t), t=-6..6], [2*cos(t), 2*sin(t), t=0..7]} );
The circle does not really look circular. In the graph window, from Projection choose Constrained to get the true shapes of the graphs. The ranges and were chosen somewhat arbitrarily. What is the effect of decreasing or increasing these ranges? Try it - and observe what is happening and why.

To draw curves given implicitly ( i.e. they are not given in the form , but in the form ) use the implicitplot command. However, this command is in the plots package. So to draw the ellipses and use

with(plots);       Load the plots package - only once in a Maple session
implicitplot( {x^2 + y^2 = 1, 4*x^2 + y^2 = 2}, x=-1..1, y=-2..2 );
Again the approximate locations of the points of intersection may be read of with the help of the pointer. Some remarks are in order here. bullistitem The plot command needs only the x range, which is determined by the region of interest. However, the implicitplot command needs the x and the y ranges. Only that part of the graph will be drawn which fits inside the rectangle determined by the range. One may choose the correct range by experimentation. Curves which can be plotted using plot may also be plotted using implicitplot but not vice versa. Wherever possible use plot instead of implicitplot because plot is faster and one does not need the y range for it (which may be hard to determine). Notice the use of the curly brackets {} when plotting two or more curves - all the equations/functions being plotted must be enclosed in these curly brackets. These curly brackets are not necessary (but may be used) when plotting a single curve.

To plot curves given in polar coordinates use the command polarplot in the plots package. To draw the circle (with ) and the cardiod (with ) in the same picture, use

with(plots);  
polarplot( { [cos(t), t, t=0..Pi], [1+cos(t), t, t=0..2*Pi] } );
Here we have used the symbol t instead of . In the plot window choose Constrained from Projection.

To superimpose two plots (obtained from different commands) use the display command in the plots package. e.g. to display the graphs of and the cardiod in the same picture. Use

with(plots):
pic1 := plot( x/2, x=-1..4, color=red ):              Note the : sign
pic2 := polarplot( [1+2*cos(t), t, t=0..2*Pi], color=green ):
display( {pic1,pic2} );
The second and third lines define two pictures pic1 and pic2 - note the : used in the two lines. We don't display their results because pic1 and pic2 are stored algebraically (instead of pictorially) and are quite a mess (change : to ; and see what happens - then scroll back and fix it). The last line displays the two pictures - superimposed.



next up previous
Next: Solving Equations Exactly Up: COMMANDS FOR MATH Previous: Some Common Errors



Peter Monk
Tue Aug 29 14:41:29 EDT 1995