Deleted Added
full compact
atan2.3 (174563) atan2.3 (181074)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 12 unchanged lines hidden (view full) ---

21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" from: @(#)atan2.3 5.1 (Berkeley) 5/2/91
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 12 unchanged lines hidden (view full) ---

21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" from: @(#)atan2.3 5.1 (Berkeley) 5/2/91
29.\" $FreeBSD: head/lib/msun/man/atan2.3 174563 2007-12-12 23:50:00Z das $
29.\" $FreeBSD: head/lib/msun/man/atan2.3 181074 2008-07-31 22:41:26Z das $
30.\"
30.\"
31.Dd December 12, 2007
31.Dd July 31, 2008
32.Dt ATAN2 3
33.Os
34.Sh NAME
35.Nm atan2 ,
36.Nm atan2f ,
32.Dt ATAN2 3
33.Os
34.Sh NAME
35.Nm atan2 ,
36.Nm atan2f ,
37.Nm atan2l ,
37.Nm carg ,
38.Nm carg ,
38.Nm cargf
39.Nm cargf ,
40.Nm cargl
39.Nd arc tangent and complex phase angle functions
40.Sh LIBRARY
41.Lb libm
42.Sh SYNOPSIS
43.In math.h
44.Ft double
45.Fn atan2 "double y" "double x"
46.Ft float
47.Fn atan2f "float y" "float x"
41.Nd arc tangent and complex phase angle functions
42.Sh LIBRARY
43.Lb libm
44.Sh SYNOPSIS
45.In math.h
46.Ft double
47.Fn atan2 "double y" "double x"
48.Ft float
49.Fn atan2f "float y" "float x"
50.Ft long double
51.Fn atan2l "long double y" "long double x"
52.In complex.h
48.Ft double
49.Fn carg "double complex z"
50.Ft float
51.Fn cargf "float complex z"
53.Ft double
54.Fn carg "double complex z"
55.Ft float
56.Fn cargf "float complex z"
57.Ft long double
58.Fn cargl "long double complex z"
52.Sh DESCRIPTION
53The
59.Sh DESCRIPTION
60The
54.Fn atan2
55and the
56.Fn atan2f
61.Fn atan2 ,
62.Fn atan2f ,
63and
64.Fn atan2l
57functions compute the principal value of the arc tangent of
58.Fa y/ Ns Ar x ,
59using the signs of both arguments to determine the quadrant of
60the return value.
61.ie '\*[.T]'utf8' \{\
62. ds Th \[*h]
63.\}
64.el \{\
65. ds Th theta
66.\}
67.Pp
68The
65functions compute the principal value of the arc tangent of
66.Fa y/ Ns Ar x ,
67using the signs of both arguments to determine the quadrant of
68the return value.
69.ie '\*[.T]'utf8' \{\
70. ds Th \[*h]
71.\}
72.el \{\
73. ds Th theta
74.\}
75.Pp
76The
69.Fn carg
77.Fn carg ,
78.Fn cargf ,
70and
79and
71.Fn cargf
80.Fn cargl
72functions compute the complex argument (or phase angle) of
73.Fa z .
74The complex argument is the number \*(Th such that
75.Li z = r * e^(I * \*(Th) ,
76where
77.Li r = cabs(z) .
78The call
79.Li carg(z)
80is equivalent to
81.Li atan2(cimag(z), creal(z)) ,
82and similarly for
81functions compute the complex argument (or phase angle) of
82.Fa z .
83The complex argument is the number \*(Th such that
84.Li z = r * e^(I * \*(Th) ,
85where
86.Li r = cabs(z) .
87The call
88.Li carg(z)
89is equivalent to
90.Li atan2(cimag(z), creal(z)) ,
91and similarly for
83.Fn cargf .
92.Fn cargf
93and
94.Fn cargl .
84.Sh RETURN VALUES
85The
95.Sh RETURN VALUES
96The
86.Fn atan2
87and the
88.Fn atan2f
97.Fn atan2 ,
98.Fn atan2f ,
99and
100.Fn atan2l
89functions, if successful,
90return the arc tangent of
91.Fa y/ Ns Ar x
92in the range
93.Bk -words
94.Bq \&- Ns \*(Pi , \&+ Ns \*(Pi
95.Ek
96radians.

--- 108 unchanged lines hidden (view full) ---

205.Xr sin 3 ,
206.Xr sinh 3 ,
207.Xr tan 3 ,
208.Xr tanh 3
209.Sh STANDARDS
210The
211.Fn atan2 ,
212.Fn atan2f ,
101functions, if successful,
102return the arc tangent of
103.Fa y/ Ns Ar x
104in the range
105.Bk -words
106.Bq \&- Ns \*(Pi , \&+ Ns \*(Pi
107.Ek
108radians.

--- 108 unchanged lines hidden (view full) ---

217.Xr sin 3 ,
218.Xr sinh 3 ,
219.Xr tan 3 ,
220.Xr tanh 3
221.Sh STANDARDS
222The
223.Fn atan2 ,
224.Fn atan2f ,
225.Fn atan2l ,
213.Fn carg ,
226.Fn carg ,
227.Fn cargf ,
214and
228and
215.Fn cargf
229.Fn cargl
216functions conform to
217.St -isoC-99 .
230functions conform to
231.St -isoC-99 .