3
$\begingroup$

Suppose a simple equation in Cartesian coordinate: $$ (x^2+ y^2)^{3/2} = x y $$ In polar coordinate the equation becomes $r = \cos(\theta) \sin(\theta)$. When I plot both, the one in polar coordinate has two extra lobes (I plot the polar figure with $\theta \in [0.05 \pi, 1.25 \pi]$ so the "flow" of the curve is clearer).

figurePolar = PolarPlot[Sin[θ] Cos[θ], {θ, 0.05 π, 1.25 π}, 
PlotStyle -> {Blue, Thick}];
figureCartesian = ContourPlot[(Sqrt[x^2 + y^2])^3 == x y, {x, -0.4, 0.4}, {y, -0.4, 0.4}, ContourStyle -> {Green, Dashed}];
GraphicsGrid[{{figurePolar, figureCartesian}}]

same function in polar and Cartesian coordinate The right one is in the Cartesian cooridnate, it is correct since $x y \geq 0$. The extra lobes in the polar (left) figure seem to be caused by Mathematica's use of negative $r$, which is against the mathematical definition. Any thoughts?

$\endgroup$
8
  • $\begingroup$ "which is against the mathematical definition" - well, that depends on your convention; for me, negative $r$ makes sense for curves like the lemniscate of Bernoulli or the spiral of Archimedes. $\endgroup$ Commented Apr 24, 2016 at 0:13
  • $\begingroup$ @J.M. So where $r = -1, \theta = \pi/4$? $\endgroup$
    – Taozi
    Commented Apr 24, 2016 at 0:41
  • $\begingroup$ Prolly you meant that when $\theta=3\pi/4$ or $\theta=-\pi/4$, you have a radius of $-1/2$. $\endgroup$ Commented Apr 24, 2016 at 1:07
  • $\begingroup$ @J.M. No, I meant to ask if we forget about the question, where does the point with polar coordinate $r = -1, \theta = \pi/4$ lays on the plane? $\endgroup$
    – Taozi
    Commented Apr 24, 2016 at 5:10
  • $\begingroup$ Well, you know the conversion from polar to Cartesian, no? Plug those values in and see for yourself. $\endgroup$ Commented Apr 24, 2016 at 5:33

4 Answers 4

7
$\begingroup$

You can always impose this constraint with the option RegionFunction:

PolarPlot[Sin[θ] Cos[θ], {θ, 0, 2π}]

enter image description here

PolarPlot[Sin[θ] Cos[θ], {θ, 0, 2π}, 
  RegionFunction -> Function[{x, y, θ, r}, r > 0]]

enter image description here

$\endgroup$
1
  • $\begingroup$ That's the way to plot the same figure as the Cartesian one, but still I am wondering why negative $r$ is allowed, the Cartesian figure is the correct one and accurately represent the function, I don't want it that after changing to polar coordinate somehow "extra features" get added. $\endgroup$
    – Taozi
    Commented Apr 24, 2016 at 5:13
5
$\begingroup$

PolarPlot purposely accepts negative radii values as well as angles beyond the range 0 to 2$\pi$. See, for example, the PolarPlot documentation here showing PolarPlot[Sin[3 t], {t, 0, Pi}], which returns this three lobe structure including values below the x-axis (even though the plot angles are only in the range 0 to Pi).

enter image description here

Since any real value of $(r,\theta)$ still maps to a unique plot point in $(x,y)$, there is no inherent problem with uniqueness in terms of plotting.

Not restricting the range of $(r,\theta$) also helps in creating more intricate plots, including spirals (as J.M. commented above) and even flowers (as shown in the documentation examples).

PolarPlot[{Sin[6 θ], Cos[6 θ]}, {θ, 0, 2 π}, Axes -> False, PlotStyle -> {Red, Blue}]

enter image description here

However, as discussed here on MathWorld, this means that "polar coordinates aren't inherently unique", because the inverse transform $(x,y)\to(r,\theta)$ is not uniquely defined (unless the range of $r,\theta$ is restricted).

$\endgroup$
5
  • $\begingroup$ Thanks, I am aware of that, I am wondering about the inconsistency between the polar and Cartesian of the same function -- with the Cartesian being the correct one. $\endgroup$
    – Taozi
    Commented Apr 24, 2016 at 5:22
  • $\begingroup$ I'm not comfortable with "over defining"; negative $r$ can be interpreted geometrically just as well as positive $r$. Just go in the direction opposite to that for positive $r$. $\endgroup$ Commented Apr 24, 2016 at 10:09
  • $\begingroup$ Thanks @J.M. You are right; "over defining" could be misleading. I have edited to say "not restricting" instead and added a brief explanation about the range of $(r,\theta)$. $\endgroup$
    – Rashid
    Commented Apr 24, 2016 at 12:21
  • $\begingroup$ Much better, now I can upvote. :) $\endgroup$ Commented Apr 24, 2016 at 12:23
  • $\begingroup$ " Just go in the direction opposite to that for positive". So you agree with a both inclusive generalisation ? $\endgroup$
    – Narasimham
    Commented Apr 26, 2016 at 4:03
2
$\begingroup$

A simpler way to restrict to positive radii:

PolarPlot[Max[Sin[θ] Cos[θ], 0], {θ, 0, 2 π}]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ But then my mathematical function in Cartesian coordinate should be $(x^2+y^2)^{3/2} = \max (x y, 0)$, which changes the definition (it should not). $\endgroup$
    – Taozi
    Commented Apr 24, 2016 at 5:24
1
$\begingroup$

$$ r = \pm \sqrt{x^2+y^2} =f(\theta)$$

Basically when you entered into polar coordinates usage you had implicatively or unwittingly accepted that all radius vectors can be either positive or negative.

It is consequential to the above artefact, negative sign makes complete sense to all polar curves of two dimensions. It has nothing to do with any particular polar curve or Mathematica.

That means you had also bargained for antisymmetric (with respect to origin)curve:

$$ (x,y) = \pm r\ (cos \theta, sin \theta ).$$

In Mathematica there are options for PlotRegion etc., as others mention.

EDIT1

That any polar curve can always be associated with its (origin mirrored ) counterpart as its dual...is sometimes disconcerting.

For example starting with the Cartesian circle

$$ (x - h)^2 + (y -k)^2= R^2 $$

if we convert to polar and accept both signs and reconvert to Cartesian coordinates, it tantamounts to accepting its dual

$$ (x + h)^2 + (y +k)^2= R^2 $$

as the polar counterpart.This is obtained by rotating the circle about origin through $ \pi .$

We may generalize:

Every polar plot has its conjugate or dual plot $(r \rightarrow -r )$ which is polar symmetric with the origin.

$\endgroup$
9
  • $\begingroup$ Thanks, I think your answer is the closest to the point, seems I didn't explain my question well. Anyway, all books have polar coordinate defined as $r = \sqrt{x^2 + y^2}, \theta = atan2(y/x)$, so $r$ must be positive by definition. For example, I know exactly where the points $r = 1, \theta = \pm \pi$ are on the polar plane, but I don't where to locate $r = -1, \theta = \pm \pi$. $\endgroup$
    – Taozi
    Commented Apr 24, 2016 at 5:20
  • $\begingroup$ As mentioned in my answer above, it is on the other side of the origin, $\endgroup$
    – Narasimham
    Commented Apr 24, 2016 at 6:43
  • $\begingroup$ $r=\cos\theta $ are $two$ circles, please note in this context. $\endgroup$
    – Narasimham
    Commented Apr 24, 2016 at 6:50
  • 1
    $\begingroup$ All books have r positive by definition? You've never explored optics... $\endgroup$
    – John Doty
    Commented Apr 25, 2016 at 11:29
  • 1
    $\begingroup$ @Narasimham en.wikipedia.org/wiki/Radius_of_curvature_(optics) $\endgroup$
    – John Doty
    Commented Apr 25, 2016 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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