ATAN2
'atan2' is a two-argument function that computes the arctangent of given ''y'' and ''x'', but with a range of . It was introduced first in many computer programming languages but is now common in all fields of science and engineering too.
| Contents |
| Definition |
| Variations |
| References |
| See also |
| External links |
| Other implementations/code for atan2 |
Definition
''atan2'' is defined using the standard arctan function, whose range is (−π/2, π/2), as follows:
:
(Note that the first parameter is ''y'' and ''x'' is the second.)
The so defined atan2 has domain in and range in (−π, π].
If is a complex number, then
:
is its argument in the interval (-π,π].
The same result is valid if a point on a plane is represented by (x,y) in cartesian coordinates and by (r,φ) in polar coordinates.
atan2 is available in most modern programming languages. The Linux Programmer's Manual [1] says:
:"The atan2 C++ function calculates the arctangent of the two variables '''y''' and '''x'''. It is similar to calculating the arctangent of '''y'''/'''x''', except that the signs of both arguments are used to determine the quadrant of the result."
Effectively, this means that
atan2(y,x) finds the counterclockwise angle in radians between the ''x''-axis and the vector 'This is the preferred form [1] for correctly finding the sign of the result in all quadrants. See also inverse trigonometric function.
:
Variations
★ In Microsoft Excel, the atan2 function has the two arguments reversed.[2] . OpenOffice.org Calc also reverses the arguments.
★ In the Intel Architecture assembler code, ''atan2'' is known as FPATAN (floating-point partial arctangent) instruction [3]. It can deal with infinities and results range from (closed interval), e.g. . Particularly, FPATAN 'is' defined when both arguments are zero:
★ :
★ :
★ :
★ :
★ :This definition is related with the concept of signed zero, i.e.
★ On the TI-89 calculator, the equivalent function is called 'R►Pθ' and has the arguments reversed.
References
1. [2]
2. Atan2 Method
3. IA-32 Intel® Architecture Software Developer’s Manual. Volume 2A: Instruction Set Reference, A-M, 2004.
See also
★ Complex number
★ Inverse trigonometric function
External links
★ C++ Programmer's Reference
★ MATLAB Function Reference
★ Mathematica Function Reference
Other implementations/code for atan2
★ [3]
★ Bearing Between Two Points
★ Arctan and Polar Coordinates
★ What's 'Arccos'?
This article provided by Wikipedia. To edit the contents of this article, click here for original source.
psst.. try this: add to faves
Featured Companies
| Green Parrot Beach Houses Resort | |
| Selloffvacations.com Oakville |

العربية
中国
Français
Deutsch
Ελληνική
हिन्दी
Italiano
日本語
Português
Русский
Español



