OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man3 / atan2.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\"     <mtk.manpages@gmail.com>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 2002-07-27 by Walter Harms
31 .\"     (walter.harms@informatik.uni-oldenburg.de)
32 .\"
33 .TH ATAN2 3  2008-11-20 "" "Linux Programmer's Manual"
34 .SH NAME
35 atan2, atan2f, atan2l \- arc tangent function of two variables
36 .SH SYNOPSIS
37 .nf
38 .B #include <math.h>
39
40 .BI "double atan2(double " y ", double " x );
41 .BI "float atan2f(float " y ", float " x );
42 .BI "long double atan2l(long double " y ", long double " x );
43
44 .fi
45 Link with \fI\-lm\fP.
46 .sp
47 .in -4n
48 Feature Test Macro Requirements for glibc (see
49 .BR feature_test_macros (7)):
50 .in
51 .sp
52 .ad l
53 .BR atan2f (),
54 .BR atan2l ():
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
56 .I cc\ -std=c99
57 .ad b
58 .SH DESCRIPTION
59 The
60 .BR atan2 ()
61 function calculates the principal value of the arc tangent of
62 .IR y/x ,
63 using the signs of the two arguments to determine
64 the quadrant of the result.
65 .SH "RETURN VALUE"
66 On success, these functions return the principal value of the arc tangent of
67 .IR y/x
68 in radians; the return value is in the range [\-pi,\ pi].
69
70 If
71 .I y
72 is +0 (\-0) and
73 .I x
74 is less than 0, +pi (\-pi) is returned.
75
76 If
77 .I y
78 is +0 (\-0) and
79 .I x
80 is greater than 0, +0 (\-0) is returned.
81
82 If
83 .I y
84 is less than 0 and
85 .I x
86 is +0 or \-0, \-pi/2 is returned.
87
88 If
89 .I y
90 is greater than 0 and
91 .I x
92 is +0 or \-0, pi/2 is returned.
93
94 .\" POSIX.1 says:
95 .\" If
96 .\" .I x
97 .\" is 0, a pole error shall not occur.
98 .\"
99 If either
100 .I x
101 or
102 .I y
103 is NaN, a NaN is returned.
104
105 .\" POSIX.1 says:
106 .\" If  the  result  underflows, a range error may occur and
107 .\" .I y/x
108 .\" should be returned.
109 .\"
110 If
111 .I y
112 is +0 (\-0) and
113 .I x
114 is \-0, +pi (\-pi) is returned.
115
116 If
117 .I y
118 is +0 (\-0) and
119 .I x
120 is +0, +0 (\-0) is returned.
121
122 If
123 .I y
124 is a finite value greater (less) than 0, and
125 .I x
126 is negative infinity, +pi (\-pi) is returned.
127
128 If
129 .I y
130 is a finite value greater (less) than 0, and
131 .I x
132 is positive infinity, +0 (\-0) is returned.
133
134 If
135 .I y
136 is positive infinity (negative infinity), and
137 .I x
138 is finite,
139 pi/2 (\-pi/2) is returned.
140
141 If
142 .I y
143 is positive infinity (negative infinity) and
144 .I x
145 is negative infinity, +3*pi/4 (-3*pi/4) is returned.
146
147 If
148 .I y
149 is positive infinity (negative infinity) and
150 .I x
151 is positive infinity, +pi/4 (-pi/4) is returned.
152 .\"
153 .\" POSIX.1 says:
154 .\" If both arguments are 0, a domain error shall not occur.
155 .SH ERRORS
156 No errors occur.
157 .\" POSIX.1 documents an optional underflow error
158 .\" glibc 2.8 does not do this.
159 .SH "CONFORMING TO"
160 C99, POSIX.1-2001.
161 The variant returning
162 .I double
163 also conforms to
164 SVr4, 4.3BSD, C89.
165 .SH "SEE ALSO"
166 .BR acos (3),
167 .BR asin (3),
168 .BR atan (3),
169 .BR carg (3),
170 .BR cos (3),
171 .BR sin (3),
172 .BR tan (3)