4
$\begingroup$

Can someone please explain to me how to convert the following equation from polar to rectangular?

r=$2^\theta$

Thus far I got:

$4^{\arctan(y/x)}$=$x^2$+ $y^2$

by squaring both sides and replacing $r^2$ with $x^2$+$y^2$ and $\theta$ with $\arctan(y/x)$

However when I graphed both of them, they were not the same and thus I think I went wrong somewhere.

Any help would be very appreciated. Sorry for the format, I'm new to this and not very good.

Thank You

$\endgroup$
1
  • $\begingroup$ Because it's $2^{2\arctan(y/x)}$ $\endgroup$
    – mathinator
    Feb 8, 2015 at 5:48

4 Answers 4

1
$\begingroup$

The formulae $$x=r\cos\theta, \quad y=r\sin\theta\tag{1}$$ relate polar and rectangular coordinates in the direction we need here. Your equation $$r=r(\theta)=2^\theta\qquad (-\infty<\theta<\infty)$$ is a so-called polar representation of a curve $\gamma\>$: Each $\theta\in{\mathbb R}$ determines a ray emanating at the origin $O$, and you are told to mark the point $P$ on this ray at distance $r=r(\theta)$ from $O$. The formulae $(1)$ then allow to compute the rectangular coordinates of $P$. In this way we obtain a parametric representation of $\gamma$ in the form $$\gamma:\quad \theta\mapsto\bigl(x(\theta),y(\theta)\bigr):=\bigl(2^\theta\cos\theta, \>2^\theta\sin\theta\bigr)\qquad (-\infty<\theta<\infty)\ .\tag{2}$$ In this parametrization $\theta$ is not any old variable quantity, but has a geometrical meaning: At any instant $\theta$ is up to a multiple of $2\pi$ the polar angle of the moving point.

If you want to work with the curve $\gamma$, e.g., compute curvatures, lengths, or areas, then $(2)$ is the preferred way to describe it. If you prefer an implicit description over a "production scheme" you could define $\gamma$ as $$\gamma:=\left\{(x,y)\in \dot{\Bbb R}^2\>\biggm|\>{\log(x^2+y^2)\over\log 4}\in{\rm arg}(x,y)\right\}\ .$$ Here ${\rm arg}$ is a set-valued function giving the polar angle of $(x,y)$ (or $z=x+iy$) "up to multiples of $2\pi$".

$\endgroup$
1
  • 1
    $\begingroup$ (+1), though I suspect the OP is looking for an implicit equation. :) $\endgroup$ Feb 8, 2015 at 13:23
1
$\begingroup$

Here is the graph you want ($r=e^{\theta}$):

enter image description here

Here is the graph you get from your attempted solution ($4^{\tan^{-1}(y/x)}=x^2+y^2$):

enter image description here

Your equation has three problems. First, you get two spirals instead of the one you desire. Second, you get only part of the spiral, because $\theta$ is too limited. Third, if the spiral continued, you would get holes at any points where $x=0$.

These problems have the same cause: using the standard arctangent function of $y/x$. The arctangent function does not distinguish between points in the first and third quadrants, or between the second and fourth quadrants. This gives you the two spirals. (This is what @Narasimham is referring to in his answer.) Even if you ignore this, $\tan^{-1}\frac yx$ is not quite equal to $\theta$. The arctangent function is indeed a function, so it limits theta to $-\pi/2<\theta<\pi/2$. The atan2 function expands the range to $-\pi<\theta\le\pi$. But polar graphing is not limited to either of those ranges for theta. Last, using the standard arctangent function requires you to use $y/x$, which is not defined for $x=0$, since there is a division by $x$.

We can remove the first and third problems by using $\mathrm{atan2(x,y)}$ rather than $\tan^{-1}\frac yx$. The second problem is removed by looking at the remainder of the angles after division by $2\pi$. Unfortunately, the atan2 function gives the wrong range to do this conveniently, so we must check its remainder as well.

Here is my Cartesian equation for your graph.

$$\mathrm{fract}\left(\frac{\mathrm{atan2}(x,y)-\log_4(x^2+y^2)}{2\pi}\right)=0$$

or perhaps

$$\mathrm{mod}(\mathrm{atan2}(x,y)-\log_4(x^2+y^2),2\pi)=0$$

Unfortunately, I do not have a graphing program that both graphs general Cartesian relations and allows the atan2 function. The best I can do replaces $\mathrm{atan2}(x,y)$ with $\mathrm{if}(x>0,\tan^{-1}(y/x),\tan^{-1}(y/x)+\pi)$, which leaves some artefacts in my grapher.

Could someone graph this for me and confirm that it is correct? Also, be careful in the use of atan2. Some environments use $\mathrm{atan2}(x,y)$ while others use $\mathrm{atan2}(y,x)$. Make sure your parameters are in the correct order for your grapher.

$\endgroup$
2
  • 1
    $\begingroup$ (+1) Your graphs nicely illustrate why finding a rectangular formula is tricky. :) Haven't tried graphing your mod formula.... $\endgroup$ Feb 8, 2015 at 13:27
  • 2
    $\begingroup$ Since the reply to your comment to another answer might be removed, I mention that you can use $$\mathrm{atan2}(x,y)=2\arctan\left(\frac{y}{x+sqrt{x^2+y^2}}\right)$$ If $x\lt0$ and $y=0$, we set $\mathrm{atan2}(x,y)=\pi$. $\endgroup$
    – robjohn
    Feb 8, 2015 at 13:41
0
$\begingroup$

$\DeclareMathOperator{\ARCCOT}{arccot}\newcommand{\arccot}{\ARCCOT}$As you're probably aware, the polar graph $r = 2^{\theta} = e^{\theta\log 2}$ is a logarithmic spiral. By "converting polar to rectangular", one normally means "find an elementary function $f$ such that $f(x, y) = 0$ is precisely the polar graph". (E.g., $r = \cos\theta$ converts to $x^{2} + y^{2} - x = 0$; or $r = a\sec\theta$ converts to $x - a = 0$.)

Here, matters are tricky, because your curve is not a "closed subset" of the plane: As $\theta \to -\infty$, the graph approaches the origin, but the origin is not on the graph. This means any $f$ describing your curve is discontinuous (or undefined) at $(0, 0)$.

Second, $f$ cannot be a polynomial or rational function because (for example) the spiral crosses the $x$-axis infinitely many times, but is not itself the $x$-axis.

Finally, there's a vexing annoyance (noted also by other answers): $\theta$ is a multiple-valued on each ray through the origin, and your curve crosses each ray infinitely many times. This means you need something like a "piecewise" function $f$ with infinitely many cases (one for each value of $\theta$ along a particular ray) to get the entire spiral.

Your attempt, $x^{2} + y^{2} = 4^{\arctan(y/x)}$, works in the right half-plane $x > 0$, on which the principal branch of $\arctan(y/x)$ is the branch of $\theta$ satisfying $-\pi/2 < \theta < \pi/2$. Letting $k$ be an arbitrary integer, and letting $\arctan$ and $\arccot$ denote principal branches, this works: $$ f(x, y) = \begin{cases} x^{2} + y^{2} - 4^{\arctan(y/x) + 2k\pi} &\quad x > 0; \\ x^{2} + y^{2} - 4^{\arccot(x/y) + 2k\pi} &\quad y > 0; \\ x^{2} + y^{2} - 4^{\arctan(y/x) + (2k+1)\pi} &\quad x < 0; \\ x^{2} + y^{2} - 4^{\arccot(x/y) + (2k+1)\pi} &\quad y < 0. \end{cases} $$ The domains of definition overlap; I leave to you the exercise that when two domains overlap, suitable choices of $k$ give the same branch of $\theta$.

$\endgroup$
0
$\begingroup$

There are two arctan functions, you should choose atan2 which takes care of sign in all quadrants,else you will get correct plot only in first quadrant.

EDIT1:

Still not working? Quadrant sensitive atan2 of Fortran is implemented slightly differently among softwares.In mathematica ArcTan[x, y] is used.Here both plot exactly same on the graph.

AA = PolarPlot[ 2^t, {t, 0, Pi}, PlotStyle -> Thick, GridLines -> Automatic]
BB = ContourPlot[ 4^ArcTan[x, y] == x^2 + y^2 , {x, -10, 3}, {y, 0, 4},ContourStyle -> Red]
Show[{AA, BB}, AspectRatio -> Automatic]

Spiral

$\endgroup$
5
  • $\begingroup$ I was not familiar with that function, so I researched it and found the conversion from $\arctan$ to atan2 and plugged that in to the equation. Unfortunately the graphs still do not match. $\endgroup$
    – mathinator
    Feb 8, 2015 at 6:19
  • $\begingroup$ Which graphing program do you use that has the atan2 function and graphs general relations? Is it easily available to poor teachers like me? $\endgroup$ Feb 8, 2015 at 11:48
  • $\begingroup$ Nobody knows for sure what atan2 is, see here: en.wikipedia.org/wiki/Atan2 $\quad$. It has no place in decent mathematics. $\endgroup$ Feb 8, 2015 at 12:37
  • $\begingroup$ This does not answer the question. It should really be a comment. $\endgroup$
    – robjohn
    Feb 8, 2015 at 13:09
  • 2
    $\begingroup$ @RoryDaulton: If your program has arctan, you can use $$\mathrm{atan2(x,y)=2\arctan\left(\frac{y}{x+\sqrt{x^2+y^2}}\right)}$$ it is not defined for $x\lt0$ and $y=0$ (where $\mathrm{atan2}(x,y)=\pi$), but it gives the proper value everywhere else. $\endgroup$
    – robjohn
    Feb 8, 2015 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .