atan2のヘルプ・マニュアル
日本語 英語
atan2 --help
man atan2
ATAN2(3) Linux Programmer’s Manual ATAN2(3)
名前
atan2, atan2f, atan2l - 二つの変数に対する逆正接(arc tangent)関数
書式
#include
double atan2(double y, double x);
float atan2f(float y, float x);
long double atan2l(long double y, long double x);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
atan2f(), atan2l(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
|| _ISOC99_SOURCE; or cc -std=c99
説明
atan2() 関数は y/x の逆正接 (arg tangent) の主値を計算する。二つの引 き
数の符号は結果の象限を決定するために使われる。
返り値
成功すると、これらの関数は y/x の逆正接の主値をラジアン単位で返す。返り
値は [-pi, pi] の範囲となる。
y が +0 (-0) で x が 0 未満の場合、+pi (-pi) が返される。
y が +0 (-0) で x が 0 より大きい場合、+0 (-0) が返される。
y が 0 未満で x が +0 か -0 の場合、-pi/2 が返される。
y が 0 より大きく x が +0 か -0 の場合、pi/2 が返される。
x か y のいずかが NaN の場合、NaN が返される。
y が +0 (-0) で x が -0 の場合、+pi (-pi) が返される。
y が +0 (-0) で x が +0 の場合、+0 (-0) が返される。
y が 0 より大きい (小さい) 有限値で x が負の無限大の場合、+pi (-pi) が
返される。
y が 0 より大きい (小さい) 有限値で x が正の無限大の場合、+0 (-0) が返
される。
y が正の無限大 (負の無限大) で x が有限値の場合、pi/2 (-pi/2) が返さ れ
る。
y が正の無限大 (負の無限大) で x が負の無限大の場合、+3*pi/4 (-3*pi/4)
が返される。
y が正の無限大 (負の無限大) で x が正の無限大の場合、+pi/4 (-pi/4) が返
される。
エラー
エラーは発生しない。
準拠
C99, POSIX.1-2001. double 版の関数は SVr4, 4.3BSD, C89 にも準拠してい
る。
関連項目
acos(3), asin(3), atan(3), carg(3), cos(3), sin(3), tan(3)
2008-11-20 ATAN2(3)
ATAN2(3) Linux Programmer’s Manual ATAN2(3)
NAME
atan2, atan2f, atan2l - arc tangent function of two variables
SYNOPSIS
#include
double atan2(double y, double x);
float atan2f(float y, float x);
long double atan2l(long double y, long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
atan2f(), atan2l(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
|| _ISOC99_SOURCE; or cc -std=c99
DESCRIPTION
The atan2() function calculates the principal value of the arc tangent
of y/x, using the signs of the two arguments to determine the quadrant
of the result.
RETURN VALUE
On success, these functions return the principal value of the arc tan-
gent of y/x in radians; the return value is in the range [-pi, pi].
If y is +0 (-0) and x is less than 0, +pi (-pi) is returned.
If y is +0 (-0) and x is greater than 0, +0 (-0) is returned.
If y is less than 0 and x is +0 or -0, -pi/2 is returned.
If y is greater than 0 and x is +0 or -0, pi/2 is returned.
If either x or y is NaN, a NaN is returned.
If y is +0 (-0) and x is -0, +pi (-pi) is returned.
If y is +0 (-0) and x is +0, +0 (-0) is returned.
If y is a finite value greater (less) than 0, and x is negative infin-
ity, +pi (-pi) is returned.
If y is a finite value greater (less) than 0, and x is positive infin-
ity, +0 (-0) is returned.
If y is positive infinity (negative infinity), and x is finite, pi/2
(-pi/2) is returned.
If y is positive infinity (negative infinity) and x is negative infin-
ity, +3*pi/4 (-3*pi/4) is returned.
If y is positive infinity (negative infinity) and x is positive infin-
ity, +pi/4 (-pi/4) is returned.
ERRORS
No errors occur.
CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
4.3BSD, C89.
SEE ALSO
acos(3), asin(3), atan(3), carg(3), cos(3), sin(3), tan(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-11-20 ATAN2(3)