# Why PolarPlot can have negative $r$?

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}}]


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?

• "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. Commented Apr 24, 2016 at 0:13
• @J.M. So where $r = -1, \theta = \pi/4$? Commented Apr 24, 2016 at 0:41
• Prolly you meant that when $\theta=3\pi/4$ or $\theta=-\pi/4$, you have a radius of $-1/2$. Commented Apr 24, 2016 at 1:07
• @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? Commented Apr 24, 2016 at 5:10
• Well, you know the conversion from polar to Cartesian, no? Plug those values in and see for yourself. Commented Apr 24, 2016 at 5:33

You can always impose this constraint with the option RegionFunction:

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


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


• 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. Commented Apr 24, 2016 at 5:13

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).

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}]


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).

• 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. Commented Apr 24, 2016 at 5:22
• 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$. Commented Apr 24, 2016 at 10:09
• 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)$. Commented Apr 24, 2016 at 12:21
• Much better, now I can upvote. :) Commented Apr 24, 2016 at 12:23
• " Just go in the direction opposite to that for positive". So you agree with a both inclusive generalisation ? Commented Apr 26, 2016 at 4:03

A simpler way to restrict to positive radii:

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


• 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). Commented Apr 24, 2016 at 5:24

$$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.

• 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$. Commented Apr 24, 2016 at 5:20
• As mentioned in my answer above, it is on the other side of the origin, Commented Apr 24, 2016 at 6:43
• $r=\cos\theta$ are $two$ circles, please note in this context. Commented Apr 24, 2016 at 6:50
• All books have r positive by definition? You've never explored optics... Commented Apr 25, 2016 at 11:29
• Commented Apr 25, 2016 at 11:47