2
$\begingroup$

This question already has an answer here:

I need to plot the polar equation $r^2=\cos\theta$, but I could not find any built-in command in Mathematica to do so. Is there any (simple) way to plot an implicit polar equation?

$\endgroup$

marked as duplicate by C. E., garej, LCarvalho, m_goldberg plotting Jul 3 '17 at 20:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2
$\begingroup$

How about:

PolarPlot[Sqrt[Cos[th]], {th, 0, 2 \[Pi]}]

enter image description here

$\endgroup$
  • $\begingroup$ Well, the question is "Is there any way to draw the graph of implicit polar equations?" PolarPlot works when the relationship is explicit, but not when it is implicit. However, it can be used for the given example, so still worth to mention. $\endgroup$ – C. E. Jul 3 '17 at 18:46
  • $\begingroup$ @C.E. It could be smth like PolarPlot[Evaluate[r /. Solve[r^2 == Cos[th], r]], {th, 0, 2 \[Pi]}] $\endgroup$ – garej Jul 3 '17 at 19:09
  • $\begingroup$ @garej I was thinking about implicit relationships in polar coordinates where a corresponding explicit formula is hard or impossible to find. Take f.e. Solve[r^2 == Cos[r th], r], this cannot be solved with Solve, and hence cannot be plotted with PolarPlot. But it can be plotted with ContourPlot. $\endgroup$ – C. E. Jul 3 '17 at 19:17
  • $\begingroup$ But this graph does not include when $r$ is negative. $\endgroup$ – James Jul 4 '17 at 4:33
  • $\begingroup$ true, technically is should be PolarPlot[{-Sqrt[Cos[th]], Sqrt[Cos[th]]}, {th, 0, 2 \[Pi]}] $\endgroup$ – Ruud3.1415 Jul 10 '17 at 15:31
2
$\begingroup$

You can use Mathematica to figure out what the corresponding relationship is in cartesian coordinates,

r^2 == Cos[th] /. {r -> Sqrt[x^2 + y^2], th -> ArcTan[x, y]}

Mathematica graphics

Using ContourPlot to plot this:

ContourPlot[
 x^2 + y^2 == x/Sqrt[x^2 + y^2],
 {x, 0, 1}, {y, -1, 1}
 ]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thanks. I like to have $x$ and $y$-axis in the graph, and I wonder if it is possible using ContourPlot. But there is also a question, that this graph does not seem include the case $r<0$. $\endgroup$ – James Jul 4 '17 at 4:35
  • $\begingroup$ @James $r$ is always zero or larger in a polar coordinate system... If you have something else in mind, you have to specify what that is. In your coordinate system, how is $r$ related to $x$ and $y$? The options for ContourPlot are well documented. Read about Frame (which you'll want to set to False) and Axes. $\endgroup$ – C. E. Jul 4 '17 at 5:02

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