PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: No information on entry rating
[parent] $\operatorname{arc tan}$ with two arguments (Definition)

When inverting the polar coordinates, one needs the arc tan function $\arctan$ with two arguments. If $ (x,y)\in \mathbbmss{R}^2\setminus\{0\}$ , then $ \arctan(x,y) $ is defined as the angle $(x,y)$ makes with the positive $x$ -axis.

One usually sees expressions like $\arctan(y/x)$ , which is equal to $\arctan(x,y)$ when $(x,y)$ is in the first quadrant. However, $\arctan(y/x)$ does not give the correct angle when $(x,y)$ is in the third quadrant (since $y/x=(-y)/(-x)$ ). Also, the quotient $y/x$ involves a division by zero when $x=0$ , which is damaging both numerically and mathematically.

In most mathematical software and programming languages the two-argument $\arctan$ is directly implemented.

In Python language the functions atan(x) and atan2(x,y) are the respective one and two argument versions of $\arctan$ . The point of having the two argument version is to determine the correct quadrant of the point. For instance, $1/1 = 1 = -1/-1$ , so atan(x) cannot distinguish between $(1,1)$ and $(-1,-1)$ , but atan2(x,y) can, as the following Python code illustrates:

>>> from math import *
>>> print atan(1)
0.785398163397
>>> print atan2(1,1)
0.785398163397
>>> print atan2(-1,-1)
-2.3619449019
because $(1,1)$ has argument $\pi/4=0.7853\ldots$ but $(-1,-1)$ has argument $-3\pi/4=-2.3619\ldots$ .

Analytic properties

In mathematical works, $\arctan(x,y)$ is simply denoted by $\theta(x, y)$ . The symbol $\theta$ obviously refers to the angle, but it is really the function $h_2$ , where $$ g(r, \theta) = (r \cos \theta, r \sin \theta)\,, \quad h(x,y) = g^{-1}(x, y) = (r, \theta)\,. $$ The function $ g \colon \mathbbmss{R}^2 \to \mathbbmss{R}^2$ is the polar-to-Cartesian coordinate transformation. By the inverse function theorem, the function $h$ (the Cartesian-to-polar coordinate transformation) exists and is smooth wherever it is defined. Note that $h$ cannot be defined continuously everywhere, because of the multi-valued nature of $\theta$ -- $(r, \theta)$ and $(r, \theta + 2\pi n)$ always map to the same point under $g$ . (Similarly, $\theta$ cannot defined when $r = \sqrt{x^2 + y^2} = 0$ .) This means, if one chases a loop (say a circle) around the origin, $\theta$ would move from $0$ to $2\pi$ , even though the image point $g(r, \theta)$ winds back to the starting point.

Technically, a ``largest'' possible domain of $h$ (and $\theta$ ) can only be taken to be some simply connected open subset of $ \mathbbmss{R}^2 \setminus \{0\}$ . (Note: $ \mathbbmss{R}^2 \setminus \{0\}$ itself is not simply connected.) For example, such a domain might be $ \mathbbmss{R}^2 \setminus \{ (x, y) : x \leq 0 \}$ , i.e. delete the negative real axis from $ \mathbbmss{R}^2$ .

The exterior derivative of $\theta$ is $$ d\theta = \frac{-y}{x^2 + y^2} \, dx + \frac{x}{x^2 + y^2} \, dy \,, $$ (found by implicit differentiation), and hence $$ \frac{\partial \theta}{\partial x} = \frac{-y}{x^2 + y^2}\,, \quad \frac{\partial \theta}{\partial y} = \frac{x}{x^2 + y^2} $$ (which can also be found by differentiating $\arctan(y/x)$ directly and piecing the results for each quadrant).

Of course, the formulas above are only valid wherever $\theta$ is defined, but the analytical expressions do not change no matter which domain of definition is taken for $\theta$ . This allows for the following neat formula to find the total variation of angle of a smooth curve $ \gamma \colon [a, b] \to \mathbbmss{R}^2 \setminus \{0 \}$ : $$ \int_{\gamma} d\theta = \int_a^b \gamma^* d\theta = \int_a^b \left( \frac{-y \dot{x} }{x^2 + y^2} + \frac{x \dot{y}}{x^2 + y^2} \right) \, dt\,. $$ (This is related to the formula for the winding number and the argument principle in complex analysis.)

For example, if $\gamma(t) = (r \cos t, r \sin t)$ , for $t \in [0, 2\pi n]$ , is the circle that winds around the origin $n$ times, then $\int_{\gamma} d\theta = 2\pi n$ .




"$\operatorname{arc tan}$ with two arguments" is owned by matte. [ full author list (5) ]
(view preamble | get metadata)

View style:

Other names:  angle function
Keywords:  arc tan, arctan, $d þeta$

This object's parent.
Log in to rate this entry.
(view current ratings)

Cross-references: complex analysis, argument principle, winding number, curve, total variation, domain of definition, valid, formulas, implicit differentiation, exterior derivative, real axis, negative, open subset, simply connected, domain, image, even, origin, circle, loop, map, multi-valued, smooth, inverse function theorem, transformation, coordinate, code, point, functions, languages, division by zero, quotient, quadrant, expressions, positive, angle, arguments, polar coordinates
There are 3 references to this entry.

This is version 8 of $\operatorname{arc tan}$ with two arguments, born on 2005-05-23, modified 2005-08-15.
Object id is 7105, canonical name is OperatornamearcTanWithTwoArguments.
Accessed 4014 times total.

Classification:
AMS MSC51-01 (Geometry :: Instructional exposition )
 51M04 (Geometry :: Real and complex geometry :: Elementary problems in Euclidean geometries)

Pending Errata and Addenda
None.
[ View all 1 ]
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add derivation | add example | add (any)