7   Parametric and Polar Curves

7.1   Parametric Curves

Example 7.1.1: The Cycloid

ParametricPlot[{t-Sin[t], 1 - Cos[t]}, {t,0,4*Pi}, AspectRatio->Automatic]

Animating the Cycloid

cycloid[] := Animate[ Show[
ParametricPlot[{t-Sin[t],1-Cos[t]},{t,-3,k},PlotRange->{{-1,13.5},{0,2.1}}],
Graphics[ {Circle[ {k,1},1], {Gray, Table[Line[{{k,1}, {k+Cos[theta],1+Sin[theta]}}],
{theta,Pi/12,2Pi,Pi/12}]},
{PointSize[.015], Red, Point[{k-Sin[k],1-Cos[k]}]}}],
Ticks->None], {k, -2, 4Pi+2}]

cycloid[]

Example 8.1.2: Lissajous Figures

GraphicsRow[ Table[ParametricPlot[{Cos[t],Sin[n*t]}, {t,0,2Pi}, Ticks->{{-1,1},{-1,1}}],{n,2,4}]]

Example 8.1.3:   Bézier Curves   (beginning on page 210)

controlPts = {{1,0},{4,2},{0,2},{3,0}}

dots = Graphics[ {PointSize[.025], Red, Point/@ controlPts}]

?Map

Show[ dots, Frame->True]

b[t_] = {(1-t)^3,3(1-t)^2*t, 3(1-t)t^2, t^3}.controlPts

In the preceding input, an explanation is needed for the  .  before controlPts

?.

The list

{(1-t)^3,3(1-t)^2*t, 3(1-t)t^2, t^3}

of length 4 can be regarded as a matrix of size  1 × 4    (i.e., one row of four components).   And, in view of

controlPts

controlPts//MatrixForm

we see that controlPts can be regarded as a matrix of size  4 × 2  (i.e., four rows and two columns).  The matrix product

(({{(1-t)^3, 3(1-t)^2t, 3(1-t)t^2, t^3}})).(({{1, 0}, {4, 2}, {0, 2}, {3, 0}}))//MatrixForm

is therefore equal to  b[t]  as a list of length  2  (i.e., a 1 × 2 matrix).  (The separtion before the first 6 of the two components of the preceding 1 × 2 matrix is not as clear as it should be.)

bezCurve = ParametricPlot[ Evaluate[ b[t] ], {t,0,1}];
Show[ dots, bezCurve, PlotRange->All, Frame->True]

bezier[ctrlPts_,opts___] := Show[ ParametricPlot[
{(1-t)^3, 3(1-t)^2*t, 3(1-t)t^2, t^3}.ctrlPts, {t,0,1}],
Graphics[{{PointSize[.02], Red, Point/@ctrlPts},
{Red, Line[ ctrlPts[[{1,2}]]], Line[ctrlPts[[{3,4}]]] } } ], 
opts, Frame->True, PlotRange->All]

bezier[{{1,0}, {4,2}, {0,2}, {3,0}}]

GraphicsGrid[
{Table[bezier[{{1,0},{k+.5,2(k-.5)/3}, {0,2}, {3,0}},
PlotRange->{{-.1,4.1}, {-.1,2.1}},
Axes->None, FrameTicks->None], {k,1,4}]}]

Manipulate[ bezier[{p1, p2, p3, p4},
Frame->None, PlotRange->{{-.1,4.1}, {-.1,3.1}}],
{{p1, {1,0}}, Locator}, {{p2, {0,3}}, Locator}, 
{{p3, {4,3}}, Locator}, {{p4, {3,0}}, Locator}]

Arc Length   (page 184)

Example 7.1.4

x[t_] = t - Sin[t]

y[t_] = 1 - Cos[t]

ParametricPlot[ {x[t], y[t]}, {t,0,2*Pi}]

integrand = Sqrt[x'[t]^2 + y'[t]^2] //Simplify

Integrate[ integrand, {t,0,2*Pi}]

Example 7.1.5

Clear[ x, y, integrand ];  x[t_] = Cos[t]

y[t_] = Sin[3t]

ParametricPlot[ {x[t], y[t]}, {t,0,2*Pi}, AspectRatio->Automatic]

integrand = Sqrt[ x'[t]^2 + y'[t]^2 ]

Integrate[ integrand, {t,0,2*Pi}]

Integrate[ integrand, {t,0,Pi/2}]

4*N[ Integrate[ integrand, {t,0,Pi/2}] ]

13.065417512240105`

N[ Integrate[ integrand, {t,0,2*Pi}] ]

13.065417511021554`

NIntegrate[ integrand, {t,0,2*Pi}]

13.065417511021554`

Problem 6, page 186.

Animate[
ParametricPlot[{Cos[t],Sin[n*t+k]}, {t,0,2Pi}, Axes->None,
PlotStyle->{Thick, Green}, Background->Black],
{k,0,2Pi}, {n,1,8,1, ControlType->SetterBar}]

7.2  Polar Curves   (beginning on page 186)

Example 7.2.1

InputForm[ θ ]

We could write something like  theta  for θ  and continue to type InputForm using only standard ASCII characters that appear in a minimal word processor such as MS NotePad.  Here, we shall break this rule by using the BasicMathInput palette to produce  θ  so that the typed commands resemble closely those of our textbook.

PolarPlot[ Log[ theta + 1 ], {theta, 0, 5*Pi}]

Example 7.2.2   (on page 187)

PolarPlot[Sin[5 θ],{θ,0,π}]

Animating a Polar Plot   (starting on page 216)

polarGrid[r_, dr_] := Graphics[ { Thickness[.001], 
Table[Circle[{0,0},k],{k, dr, r, dr}], Table[
Line[{{0,0}, r{Cos[t], Sin[t]}}], {t, Pi/12, 2Pi, Pi/12}]}]

polarGrid[1, .1]

polarGrid[1, .2]

polarCurve[r_, {θ_, θ1_, θ2_}, rmax_, opts___] := 
Module[{ r2=r /. θ->θ2 , pt2 = {Cos[θ2], Sin[θ2]}},
Show[ polarGrid[ rmax, rmax/5], 
PolarPlot[r, {θ, θ1, θ2}, PlotStyle->AbsoluteThickness[1]],
Graphics[{{Purple, Thickness[.005], Line[{{0,0}, rmax*pt2}]},
{If[ r2>0, Green, Red], Thick, Opacity[.5],
Line[{{0,0}, r2*pt2}]}, {PointSize[.025], Point[r2*pt2]}}],
opts, PlotRange->1.02*rmax *{{-1,1}, {-1,1}}]]

polarCurve[Cos[θ], {θ, 0, Pi/3},1]

polarMovie[r_, {θ_, θ1_, θ2_}, rmax_] := 
Animate[ GraphicsRow[{polarCurve[ r, {θ, θ1,k}, rmax], 
Plot[r, {θ, θ1,k}, Ticks->{{Pi,2Pi}, None}, 
PlotRange->{{θ1, θ2}, {-rmax, rmax}},  ImageSize->150]}, 20],
{k, θ1+Pi/12,θ2, Pi/12}]

polarMovie[ Cos[2*θ], {θ, 0, 2*Pi}, 1]

The preceding is from page 188.

Arc Length   (of a curve in polar coordinates --- page 189)

Example 7.2.3   (on page 219)

r[θ_] = Cos[2*θ]

Show[polarGrid[1.1,.1], PolarPlot[r[θ], {θ,0,2Pi}], Axes->True]

polarCurve[ Cos[2θ], {θ, 0, Pi/4}, 1 ]

integrand = Sqrt[ r[θ]^2 + r'[θ] ^2]

arclength = 8*Integrate[ integrand, {θ, 0, Pi/4}]

N[arclength]

Example 7.2.4 of page 190

r[θ_] = E^(-θ/5)

Show[polarGrid[1.1,.1], PolarPlot[ r[θ],{θ,0,5Pi},PlotStyle->AbsoluteThickness[2]], Axes->True]

integrand = Sqrt[ r[θ]^2 + r'[θ]^2 ]

arclen = Integrate[ integrand, {θ, 0, Infinity} ]

N[ arclen ]

Plotting a “Polar Region”   (beginning at page 220)

polarQuad[{α_, β_}, {r1α_, r1β_}, {r2α_, r2β_}] :=Polygon[{r1α*{Cos[α], Sin[α]}, r2α*{Cos[α], Sin[α]}, r2β*{Cos[β], Sin[β]}, r1β*{Cos[β], Sin[β]}}]

Graphics[{LightGray, polarQuad[{Pi/6,Pi/4},{.3,.4},{1,.8}]}]

Before using the following, be sure to load polarQuad

polarRegion[{r1_,r2_}, {θ_, θ1_, θ2_}, rmax_, opts___] := 
Module[{f,g,curves, rays, radius, shading, dθ = Pi/36., p2},
g[x_] := r1 /. θ->x; f[x_] := r2 /. θ->x; p2 = {Cos[θ2], Sin[θ2]}; 
curves = PolarPlot[{r1, r2}, {θ, θ1,θ2}]; 
rays = 
Graphics[{Blue, Line[rmax*{{Cos[θ1], Sin[θ1]}, {0,0}, p2}]}]; 
radius = Graphics[{If[ f[θ2] - g[θ2] > 0, Green, Red], Thick,
Opacity[.5], Line[ {g[θ2]*p2, f[θ2]*p2}]}]; shading = 
Table[ Graphics[{Opacity[.1], Blue, polarQuad[ {t-dθ, t},
{g[t-dθ], g[t]}, {f[t-dθ], f[t]}]}], {t, θ1 + dθ, θ2, dθ}];
Show[ shading, polarGrid[rmax, rmax/10], rays, curves, 
radius, opts, PlotRange->1.02*rmax*{{-1,1}, {-1,1}}]]

polarRegion[{2Cos[θ]/3, Cos[θ]}, {θ, 0, Pi/4}, 1]

The following was the version in the second edition of this textbook.

OLDpolarRegion[{φ_, ϕ_}, {θ_, θstart_, θend_}, rmax_, opts___] := Module[{curves, rays, radius, shading}, curves = PolarPlot[{φ, ϕ}, {θ, θstart, θend}, Ticks->None, DisplayFunction->Identity]; rays = Graphics[{Hue[.8,.5,1], Thickness[.01], Line[ 1.03*rmax*{ {Cos[θstart], Sin[θstart]}, {0,0}, {Cos[θend], Sin[θend]} }]}]; radius = Graphics[{Hue[(1+ Sign[(ϕ-φ) /. θ->θend])/6,1,.75], Thickness[.01], Line[{(φ/.θ->θend)*{Cos[θend], Sin[θend]}, (ϕ/.θ->θend)*{Cos[θend], Sin[θend]}}]}]; shading = Table[ Graphics[{GrayLevel[.9], polarQuad[{γ-π/36, γ}, {φ/.θ->γ-π/36, φ/.θ->γ}, {ϕ/.θ->γ-π/36, ϕ/.θ->γ}]}], {γ,θstart+π/36, θend, π/36}];Show[ shading, polarGrid[rmax,rmax/5], rays, curves, radius, opts, AspectRatio->Automatic, PlotRange->{{-1.03*rmax, 1.03*rmax}, {-1.02*rmax, 1.02*rmax}}]]

OLDpolarRegion[{2Cos[θ]/3, Cos[θ]}, {θ,0,π/4}, 1]

Back to the sixth edition on page 191

Area   (starting on page 191)

Example 7.2.5   (on page 191)

polarRegion[{0, Sin[3θ]}, {θ, 0, π/3}, 1]

Integrate[ (1/2)*Sin[3θ]^2, {θ,0,π/3}]

Example 7.2.6   (on pages 192-193)

polarRegion[{2, 3Sin[θ]}, {θ, 0, π}, 3]

polarRegion[{2, 3Sin[θ]}, {θ, ArcSin[2/3], π -  ArcSin[2/3]}, 3]

area = 2*Integrate[ (1/2)*(9*Sin[θ]^2 - 4), {θ, ArcSin[2/3], π/2}]

N[ area ]

For the examination to be given during the last week of classes (this Winter Quarter), anticipate problems similar to Numbers 6 and 7 on page 224.  They are concerned with various closed curves given in polar coordinates and areas of regions that they enclose.

Exphasis for the quiz next class will be on the use of the command   PolarPlot

?PolarPlot

Problems from page A67 of Stewart' s Calculus Textbook, third edition

Problem 35.   Sketch  (r^2)= 4 cos(2θ)  after plotting y = cos(2x), for -(π/4) ≤x ≤ (π/4)

Plot[Cos[2x],{x,-Pi/4,Pi/4}]

PolarPlot[{2Sqrt[Cos[2theta]],-2Sqrt[Cos[2theta]]},{theta,-Pi/4,Pi/4}]

Problem 46, Sketch the six indicated curves presented as (a) through (f).

(a)

PolarPlot[Sin[theta/2],{theta,0,4Pi}]

(b)

PolarPlot[Sin[theta/4],{theta,0,8Pi}]

(c)

PolarPlot[Sec[3theta],{theta,0,2Pi}]

(d)

PolarPlot[theta*Sin[theta],{theta,-20Pi,20Pi}]

(e)

PolarPlot[1+4Cos[5theta],{theta,0,2Pi}]

(f)

PolarPlot[ 1/Sqrt[theta],{theta,.1,50}]

The number of petals.

PolarPlot[Cos[3 theta],{theta,0,2 π}]

Find the area enclosde by one petal of the preceding curve.

-Pi/2<=3theta≤Pi/2

-Pi/6 ≤ 3theta ≤ Pi/6

area = (1/2)Integrate[Cos[3theta]^2,{theta,-Pi/6,Pi/6}]

or

r[theta_] = Cos[3theta]

area = (1/2)Integrate[ r[theta]^2,{theta,-Pi/6,Pi/6}]

PolarPlot[Cos[2theta],{theta,0,2Pi}]

PolarPlot[Cos[4theta],{theta,0,2Pi}]

PolarPlot[Cos[5theta],{theta,0,2Pi}]

Note that:  for n = 1, 2, 3, 4, ..., the polar graph of  r = sin(nθ)  or  r = cos(nθ)  has n petals if n is odd and it has 2n petals if n is even.  We are not informed about flowers having six (or ten or fourteen, or etc.) petals.  Provided they may overlap, we could try something like the following.

PolarPlot[{Cos[(3/2)theta],-Cos[(3/2)theta]},{theta,0,2Pi}]

PolarPlot[{Cos[(5/2)theta],-Cos[(5/2)theta]},{theta,0,2Pi}]

PolarPlot[{Cos[(7/2)theta],-Cos[(7/2)theta]},{theta,0,2Pi}]