Polar Graph with Rectangular Graph

Manipulate[
maxtheta=Switch[f,functionlist[[1,1]],Pi,functionlist[[7,1]],8Pi,f,2Pi];
If[t>maxtheta,t=maxtheta];
Column[{
Text@Row[{Style["r",Italic],"(θ)"," = " ,TraditionalForm[f[θ]]}],
Grid[{{
Column[{
Style[StringJoin["polar graph"],"Label",15],
Show[
PolarPlot[f[t1],{t1,0,maxtheta},AxesLabel->{Style["x",15,Italic],Style["y",15,Italic]},ImageSize->298,PlotRange->5,AspectRatio->Automatic],
Graphics[{
{Red,Line[{{0,0},{5*Cos[t],5*Sin[t]}}]},
{Black,Arrow[{{0,0},{f[t]*Cos[t],f[t]*Sin[t]}}]}
}]]},Center],
Column[{
Style[StringJoin["rectangular graph"],"Label",15],
Show[
Plot[f[t1],{t1,0,maxtheta},AxesLabel->{Style["θ",15],Style["r",15,Italic]},ImageSize->298,PlotRange->{{0,maxtheta},{-6,6.1}}],
Graphics[{
{Red,Line[{{t,0},{t,5}}]},
{Black,Arrow[{{t,0},{t,f[t]}}]}
}],Ticks->{If[maxtheta==8Pi,Range[0,maxtheta,Pi/2],Union[Range[0,maxtheta,Pi/6],Range[0,maxtheta,Pi/4]]],Automatic}]},Center]
}}]
},ItemSize->{Automatic,5}]
,
{{t,0,"theta"},0,Dynamic@maxtheta},
Button["reset",t=0],
{{f,Function[{x1},4Cos[x1]],"r(θ)"},functionlist,PopupMenu},
{{maxtheta,1},ControlType->None},
Initialization:>(
functionlist={Function[{x1},4Cos[x1]]->"circle",
Function[{x1},3(0.5+Cos[x1])]->"limaçon X",
Function[{x1},3(0.5+Sin[x1])]->"limaçon, Y",
Function[{x1},9Sin[x1]*(Cos[x1]^2)]->"bifolium",
Function[{x1},1.5(1-Cos[x1])]->"cardioid",
Function[{x1},2(1-Sin[x1])]->"heart curve",
Function[{x1},3*Sin[3/4x1]]->"rose curve",
Function[{x1},1.5*(E^(Sin[x1])-2Cos[4*x1])]->"butterfly curve"};
),
AutorunSequencing->{1,2}
]

This Demonstration offers another perspective on polar graphing. It compares the radius r and the angle θ in two graphs: polar and rectangular. As you shift θ, you can see the relationship between the two types of graphs.

Contributed by: Allen Huang