9

How can I plot $\theta=\cos r$ in polar plane? Of course I know that it is different from $r=\cos \theta.$

Kuba
  • 136,707
  • 13
  • 279
  • 740
Nimbigli
  • 349
  • 1
  • 7
  • does this work: PolarPlot[ArcCos[t], {t, -Pi, Pi}]? – Basheer Algohi Dec 04 '14 at 05:18
  • ContourPlot[θ == Cos[r], {r, 0, 50}, {θ, -π, π}, MaxRecursion -> 2, PlotPoints -> 50, PlotRange -> All, AspectRatio -> Automatic, DisplayFunction -> ReplaceAll[{r_Real, t_Real} :> {r*Cos[t], r*Sin[t]}]] https://mathematica.stackexchange.com/a/300018/72111 – cvgmt Mar 06 '24 at 10:48

4 Answers4

13
  • If you can transform it to a parametric form:

    ParametricPlot[
      Evaluate @ CoordinateTransform["Polar" -> "Cartesian", {r, Cos[r]}], 
      {r, 0, 50}
    ]
    

    enter image description here

  • And if you have to use implicit form:

    ContourPlot[
        Evaluate[
            TransformedField[
                "Polar" -> "Cartesian", θ == Cos[r], {r, θ} -> {x, y}
            ] 
        ]
      , {x, 0, 50}
      , {y, -50, 50}
      , PlotPoints -> 25
      , AspectRatio -> Automatic
      , Frame -> False, Axes -> True
     ]
    

    enter image description here

Kuba
  • 136,707
  • 13
  • 279
  • 740
7

Does this work for you:

PolarPlot[{ArcCos[t], -ArcCos[t]}, {t, -1,1}]

enter image description here

Update: (Sjoerd C. de Vries comment)

For all r

r=(+/-)ArcCos[t]+2 n Pi

Taking few of r results:

Show[Table[
  PolarPlot[{ArcCos[t], -ArcCos[t]} + n 2 Pi, {t, -1, 1}, 
   PlotRange -> All], {n, -10, 10}]]

enter image description here

Basheer Algohi
  • 19,917
  • 1
  • 31
  • 78
4

Another possible solution is to

  1. ContourPlot the equation directly;

  2. Make the coordinate transform on the coordinates of points inside the resulting graphic.

I've wrapped these steps in a function:

ClearAll@implicitPlot
implicitPlot[eq_, range__, coordSys_, opt : OptionsPattern[ContourPlot]] := 
 Module[{coord}, 
  With[{plot = ContourPlot[eq, range, opt, PlotRange -> All], 
    trans = #[coord, #2] &[Function, 
       CoordinateTransform[coordSys -> "Cartesian", {coord[1], coord[2]}]] /. 
      coord[i_] :> Part[coord, i]}, 
   plot /. GraphicsComplex[coord_, rest_] :> 
     GraphicsComplex[trans[coord\[Transpose]]\[Transpose], rest]]]

implicitPlot[Cos@r == theta, {r, 0, 40}, {theta, -8 Pi, 8 Pi}, "Polar", 
 PlotPoints -> 100]

Mathematica graphics

The advantage of this approach is, it allows us to directly set domain of definition under the interested coordinate system.

xzczd
  • 65,995
  • 9
  • 163
  • 468
3

for completeness this can be done with ContourPlot (solutions already given are faster and probably better quality)

ContourPlot[
 Cos[Norm[{x, y}]] - ArcTan[x, y] == 0, {x, 0, 100}, {y, -100, 100}, 
 PlotPoints -> 100]

enter image description here

george2079
  • 38,913
  • 1
  • 43
  • 110