LearningGuide

# plot tanx x 2pi2pi y 44 4 3 y2 1 6 4 2 0 1

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: following plot is unconstrained. > plot( exp(x), x=0..3 ); 20 18 16 14 12 10 8 6 4 2 0 0.5 1 1.5 x 2 2.5 3 The following is the constrained version of the same plot. > plot( exp(x), x=0..3, scaling=constrained); 108 • Chapter 5: Plotting 20 18 16 14 12 10 8 6 4 2 012 3 x Polar Coordinates Cartesian (ordinary) coordinates is the Maple default and is one among many ways of specifying a point in the plane. Polar coordinates, (r, θ), can also be used. In polar coordinates, r is the distance from the origin to the point, while θ is the angle, measured in the counterclockwise direction, between the x-axis and the line through the origin and the point. You can plot a function in polar coordinates by using the polarplot command in the plots package. To access the short form of this command, you must ﬁrst employ the with(plots) command. > with(plots): Figure 4.1 The Polar Coordinate System r y θ 0 x Use the following syntax to plot graphs in polar coordinates. 5.1 Graphing in Two Dimensions • 109 polarplot( r-expr, angle =range ) In polar coordinates, you can specify the circle explicitly, namely as r = 1. > polarplot( 1, theta=0..2*Pi, scaling=constrained ); 1 0.5 –1 –0.5 –0.5 –1 0.5 1 Use the scaling=constrained option to make the circle appear round. Here is the graph of r = sin(3θ). > polarplot( sin(3*theta), theta=0..2*Pi ); 0.4 0.2 –0.8–0.6–0.4–0.2 0 –0.2 –0.4 –0.6 –0.8 –1 0.2 0.4 0.6 0.8 The graph of r = θ is a spiral. > polarplot(theta, theta=0..4*Pi); 110 • Chapter 5: Plotting –5 8 6 4 2 –2 –4 –6 –8 –10 5 10 The polarplot command also accepts parametrized plots. That is, you can express the radius and angle coordinates in terms of a parameter, for example, t. The syntax is similar to a parametrized plot in Cartesian (ordinary) coordinates. See this section, page 106. polarplot( [ r-expr, angle-expr, parameter =range ] ) The equations r = sin(t) and θ = cos(t) deﬁne the following graph. > polarplot( [ sin(t), cos(t), t=0..2*Pi ] ); 0.4 0.2 –1 –0.5 –0.2 –0.4 0.5 1 Here is the graph of θ = sin(3r). > polarplot( [ r, sin(3*r), r=0..7 ] ); 5.1 Graphing in Two Dimensions • 111 4 2 0 –2 –4 1 2 3 4 5 6 Functions with Discontinuities Functions with discontinuities require extra attention. This function has two discontinuities, at x = 1 and at x = 2. −1 if x < 1, 1 if 1 ≤ x < 2, f (x) = 3 otherwise. Deﬁne f (x) in Maple. > f := x -> piecewise( x<1, -1, x<2, 1, 3 ); f := x → piecewise(x < 1, −1, x < 2, 1, 3) > plot(f(x), x=0..3); 3 2 1 0 –1 0.5 1 1.5 x 2 2.5 3 Maple draws almost vertical lines near the point of a discontinuity. The option discont=true indicates that there may be discontinuities. 112 • Chapter 5: Plotting > plot(f(x), x=0..3, discont=true); 3 2 1 0 –1 0.5 1 1.5 x 2 2.5 3 Functions with Singularities Functions with singularities, that is, those functions which become arbitrarily large at some point, constitute anothe...
View Full Document

## This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online