0
$\begingroup$

I want to display PolarPlot in the form of surface plot. I don't know how to achieve this task. for example I have chossen a very simple problem

                     a=4;
                     PolarPlot[Cos[x*a],{x,0,Pi}]

which returns the above pattern. I want to display the same pattern in Surface Plot form.
enter image description here for reference please see the below Pic enter image description here

$\endgroup$
1
$\begingroup$

The PolarPlot for your given function is actually

a = 2;
PolarPlot[Cos[x*a], {x, 0, Pi}]

enter image description here

The PolarPlot that you show corresponds to

a = 4;
PolarPlot[Sin[x*a], {x, 0, 2 Pi}]

enter image description here

To display radius as a function of angle on a cartesian Plot

Plot[Abs[Sin[x*a]], {x, -Pi, Pi}]

enter image description here

Or as a LogPlot

enter image description here

The far-field radiation patterns that you show are not related to your function or your PolarPlot

EDIT: Using RegionPlot

RegionPlot[
 -Sqrt[x^2 + y^2] <= Sin[a*ArcTan[y/x]] <=
  Sqrt[x^2 + y^2],
 {x, -1, 1}, {y, -1, 1},
 MaxRecursion -> 5]

enter image description here

EDIT 2: Using DensityPlot

DensityPlot[Sin[a*ArcTan[y/x]],
 {x, -1, 1}, {y, -1, 1},
 RegionFunction -> Function[{x, y, f},
   -Sqrt[x^2 + y^2] >= f || f >= Sqrt[x^2 + y^2]],
 PlotPoints -> 100,
 MaxRecursion -> 3]

enter image description here

$\endgroup$
  • $\begingroup$ Then I want to know how the polar pattern actually appears in Density plot. Which function is used. $\endgroup$ – Master Physics Mar 11 '17 at 15:15
  • $\begingroup$ Recommend that you edit your question to clarify what function you are working with and what output you are trying to accomplish. $\endgroup$ – Bob Hanlon Mar 11 '17 at 15:22
  • $\begingroup$ Bob Hanlon , I want to know only whether it is possible to achieve the same pattern (as that of Polar) in Density Plot. $\endgroup$ – Master Physics Mar 11 '17 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.