1 '\" te 2 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved. 3 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved. 4 .\" Portions Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. 5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at 6 .\" http://www.opengroup.org/bookstore/. 7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. 8 .\" This notice shall appear on any product containing this material. 9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 12 .TH atan2 3M "12 Jul 2006" "SunOS 5.11" "Mathematical Library Functions" 13 .SH NAME 14 atan2, atan2f, atan2l \- arc tangent function 15 .SH SYNOPSIS 16 .LP 17 .nf 18 c99 [ \fIflag\fR... ] \fIfile\fR... \fB-lm\fR [ \fIlibrary\fR... ] 19 #include <math.h> 20 21 \fBdouble\fR \fBatan2\fR(\fBdouble\fR \fIy\fR, \fBdouble\fR \fIx\fR); 22 .fi 23 24 .LP 25 .nf 26 \fBfloat\fR \fBatan2f\fR(\fBfloat\fR \fIy\fR, \fBfloat\fR \fIx\fR); 27 .fi 28 29 .LP 30 .nf 31 \fBlong double\fR \fBatan2l\fR(\fBlong double\fR \fIy\fR, \fBlong double\fR \fIx\fR); 32 .fi 33 34 .SH DESCRIPTION 35 .sp 36 .LP 37 These functions compute the principal value of the arc tangent of \fIy/x\fR, 38 using the signs of both arguments to determine the quadrant of the return 39 value. 40 .SH RETURN VALUES 41 .sp 42 .LP 43 Upon successful completion, these functions return the arc tangent of 44 \fIy\fR/\fIx\fR in the range [ \(mi\c 45 .if n pi\c 46 .if t \(*p 47 \c 48 ,\c 49 .if n pi\c 50 .if t \(*p 51 \c 52 ] radians. 53 .sp 54 .LP 55 If \fIy\fR is \(+-0 and \fIx\fR is < 0, \(+-\c 56 .if n pi\c 57 .if t \(*p 58 \c 59 is returned. 60 .sp 61 .LP 62 If \fIy\fR is \(+-0 and \fIx\fR is > 0, \(+-0 is returned. 63 .sp 64 .LP 65 If \fIy\fR is < 0 and \fIx\fR is \(+-0, \(mi\c 66 .if n pi\c 67 .if t \(*p 68 \c 69 /2 is returned. 70 .sp 71 .LP 72 If \fIy\fR is > 0 and \fIx\fR is \(+-0, \c 73 .if n pi\c 74 .if t \(*p 75 \c 76 /2 is returned. 77 .sp 78 .LP 79 If \fIx\fR is 0, a pole error does not occur. 80 .sp 81 .LP 82 If either \fIx\fR or \fIy\fR is NaN, a NaN is returned. 83 .sp 84 .LP 85 If \fIy\fR is \(+-0 and \fIx\fR is -0, \(+-\c 86 .if n pi\c 87 .if t \(*p 88 \c 89 is returned. 90 .sp 91 .LP 92 If \fIy\fR is \(+-0 and \fIx\fR is +0, \(+-0 is returned. 93 .sp 94 .LP 95 For finite values of \(+-\fIy\fR > 0, if x is \(miInf, \(+-\c 96 .if n pi\c 97 .if t \(*p 98 \c 99 is returned. 100 .sp 101 .LP 102 For finite values of \(+-\fIy\fR > 0, if x is +Inf, \(+-0 is returned. 103 .sp 104 .LP 105 For finite values of \fIx\fR, if \fIy\fR is \(+-Inf, \(+-\c 106 .if n pi\c 107 .if t \(*p 108 \c 109 /2 is returned. 110 .sp 111 .LP 112 If \fIy\fR is \(+-Inf and \fIx\fR is \(miInf, \(+-3\c 113 .if n pi\c 114 .if t \(*p 115 \c 116 /4 is returned. 117 .sp 118 .LP 119 If \fIy\fR is \(+-Inf and \fIx\fR is +Inf, \(+-\c 120 .if n pi\c 121 .if t \(*p 122 \c 123 /4 is returned. 124 .sp 125 .LP 126 If both arguments are 0, a domain error does not occur. 127 .SH ERRORS 128 .sp 129 .LP 130 No errors are defined. 131 .SH ATTRIBUTES 132 .sp 133 .LP 134 See \fBattributes\fR(5) for descriptions of the following attributes: 135 .sp 136 137 .sp 138 .TS 139 tab() box; 140 cw(2.75i) |cw(2.75i) 141 lw(2.75i) |lw(2.75i) 142 . 143 ATTRIBUTE TYPEATTRIBUTE VALUE 144 _ 145 Interface StabilityStandard 146 _ 147 MT-LevelMT-Safe 148 .TE 149 150 .SH SEE ALSO 151 .sp 152 .LP 153 \fBatan\fR(3M), \fBisnan\fR(3M), \fBmath.h\fR(3HEAD)\fBtan\fR(3M), 154 \fBattributes\fR(5), \fBstandards\fR(5)