We have angle=arctan(dy/dx), but what happens when dx=0?

14.6k Views Asked by At

Here is a formula: $\text{angle}=\arctan(dy/dx)$.

I can find an angle with my calculator for any value except $dx=0$.

My question is: is there no angle or, is there something that says when $dx=0$ the angle is found differently?

3

There are 3 best solutions below

0
On BEST ANSWER

If $dx$ is $0$, if you look in the Cartesian plane, you are standing in the y-axis, so the angle would be $\frac{\pi}{2}$ or $\frac{3\pi}{2}$, depending if $dy > 0$ or $dy < 0$.

0
On

Actually, the $angle$ that a point in $R^2$ with cartesian coordinates $(x,y)\neq (0,0)$ makes with the positive x-axis is defined as the value $\theta (x,y)$ such that

$\cos \theta (x,y) = \frac{x}{\sqrt{x^2+y^2}}$ and

$\sin \theta (x,y) = \frac{y}{\sqrt{x^2+y^2}}$,

with $\theta\in [0, 2\pi)$. Note that, defined in this way, there is a unique $\theta$ for each point different from $(0,0)$.

If $x>0$ and $y>0$, these formulas combined give $\theta (x,y) = \arctan(y/x)$.

If $x=0$ and $y>0$, it follows from the definition that $\theta=\pi/2$.

You can also consider $\theta \in[-\pi,\pi)$, and in this case the formula $\theta (x,y) = \arctan(y/x)$ is valid for all $y$ provided $x>0$.

0
On

Since none of the answers have mentioned this, I'm putting this for completeness' sake: advanced calculators and computing environments provide for a "two-argument" arctangent function $\arctan(x,y)$ (denoted as atan2() in some environments, and with the order of the arguments sometimes reversed) that is especially intended for polar coordinate conversions. Briefly, $\arctan(x,y)$ gives the same results as $\arctan\frac{y}{x}$, adjusted when necessary so that the result is within $(-\pi,\pi]$, taking into account which quadrant the point $(x,y)$ is in. When $x=0$ and $y\neq 0$, $\arctan(0,y)=\frac{\pi}{2}\mathrm{sign}\,y$.