How can I plot $\theta=\cos r$ in polar plane? Of course I know that it is different from $r=\cos \theta.$
4 Answers
If you can transform it to a parametric form:
ParametricPlot[ Evaluate @ CoordinateTransform["Polar" -> "Cartesian", {r, Cos[r]}], {r, 0, 50} ]
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 ]
Does this work for you:
PolarPlot[{ArcCos[t], -ArcCos[t]}, {t, -1,1}]
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}]]
-
$\begingroup$ Let $\theta$ is arbitrary, How is the graph? $\endgroup$– NimbigliCommented Dec 4, 2014 at 5:45
-
$\begingroup$ I don't understand you. but in general for each theta you will find r using ArcCos[theta]. then {theta,r} will be a point in the plot. $\endgroup$ Commented Dec 4, 2014 at 5:52
-
2$\begingroup$ I suppose you should take into account that r is unrestricted, so you have to work with Mod 2 pi. $\endgroup$ Commented Dec 4, 2014 at 7:28
-
$\begingroup$ Why is left side included? theta is Cos[r] so in <-1,1> interval, right? $\endgroup$– KubaCommented Dec 4, 2014 at 9:40
-
1$\begingroup$ That's probably kind of academic discussion but there is Cos[r] and r is > 0, if you assume that r can be negative, then ok. $\endgroup$– KubaCommented Dec 4, 2014 at 9:54
Another possible solution is to
ContourPlot
the equation directly;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]
The advantage of this approach is, it allows us to directly set domain of definition under the interested coordinate system.
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]
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]}]]
mathematica.stackexchange.com/a/300018/72111 $\endgroup$