天天看点

atan2 atan

atan2 definition

In terms of the standard arctan function, whose range is (?π/2,

π/2), it can be expressed as follows:

<dl></dl>

<dd></dd>

Notes:

This produces results in the range (?π,

π], which can be mapped to [0,

2π) by adding 2π to

negative results.

Traditionally, atan2(0, 0) is

undefined.

The C function atan2, and most other computer

implementations, are designed to reduce the effort of transforming

cartesian to polar coordinates and so always

define atan2(0, 0). On implementations without , or when given positive zero arguments, it is normally defined as

0. It will always return a value in the range [?π, π] rather than raising an error or

returning a  (Not a Number).

Systems supporting symbolic mathematics normally return an undefined

value for atan2(0,0) or otherwise signal that an

abnormal condition has arisen.

For systems implementing , ,

or  (for example, ), it is common to implement reasonable extensions which

may extend the range of values produced to include ?π and ?0. These also may return NaN or raise an

exception when given a NaN argument.

For systems implementing  (for example, ), atan2(-0, x), x &lt; 0 returns the value ?π. atan2(+0,

x), x &lt; 0 still returns +π.

 atan

    interval is

(-pi/2,pi/2)