209 lines
4.8 KiB
Groff
209 lines
4.8 KiB
Groff
.\" Copyright (c) 1991 The Regents of the University of California.
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" from: @(#)atan2.3 5.1 (Berkeley) 5/2/91
|
|
.\" %FreeBSD: src/lib/msun/man/atan2.3,v 1.6.2.4 2001/12/17 10:08:36 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd May 2, 1991
|
|
.Dt ATAN2 3
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm atan2 ,
|
|
.Nm atan2f
|
|
.Nd 2 ¤Ä¤ÎÊÑ¿ô¤ÎµÕÀµÀÜ´Ø¿ô
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libm
|
|
.Sh ½ñ¼°
|
|
.Fd #include <math.h>
|
|
.Ft double
|
|
.Fn atan2 "double y" "double x"
|
|
.Ft float
|
|
.Fn atan2f "float y" "float x"
|
|
.Sh ²òÀâ
|
|
.Fn atan2
|
|
´Ø¿ô¤È
|
|
.Fn atan2f
|
|
´Ø¿ô¤Ï¡¢
|
|
.Fa y/ Ns Ar x
|
|
¤ÎµÕÀµÀܤμçÃͤò·×»»¤·¤Þ¤¹¡£¤½¤ÎºÝ¡¢
|
|
ξÊý¤Î°ú¿ô¤ÎÉ乿¤ò»ÈÍѤ·¤ÆÌá¤êÃͤξݸ¤òȽÄꤷ¤Þ¤¹¡£
|
|
.Pp
|
|
.Sh Ìá¤êÃÍ
|
|
.Fn atan2
|
|
´Ø¿ô¤È
|
|
.Fn atan2f
|
|
´Ø¿ô¤Ï¡¢½èÍý¤¬À®¸ù¤¹¤ë¤È¡¢ÈϰÏ
|
|
.Bk -words
|
|
.Bq \&- Ns \*(Pi , \&+ Ns \*(Pi
|
|
.Ek
|
|
¤Î¥é¥¸¥¢¥ó¤Ç¡¢
|
|
.Fa y/ Ns Ar x
|
|
¤ÎµÕÀµÀܤòÊÖ¤·¤Þ¤¹¡£
|
|
.Fa x
|
|
¤È
|
|
.Fa y
|
|
¤ÎξÊý¤¬ 0 ¤Î¾ì¹ç¡¢
|
|
¥°¥í¡¼¥Ð¥ëÊÑ¿ô
|
|
.Va errno
|
|
¤¬
|
|
.Er EDOM
|
|
¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
|
|
.Tn VAX
|
|
¤Ç¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£
|
|
.Bl -column atan2_(y,x)_:=____ sign(y)_(Pi_atan2(Xy_xX))___
|
|
.It Fn atan2 y x No := Ta
|
|
.Fn atan y/x Ta
|
|
.Ar x
|
|
> 0
|
|
¤Î¾ì¹ç
|
|
.It Ta sign( Ns Ar y Ns )*(\*(Pi -
|
|
.Fn atan "\\*(Bay/x\\*(Ba" ) Ta
|
|
.Ar x
|
|
< 0
|
|
¤Î¾ì¹ç
|
|
.It Ta
|
|
.No 0 Ta
|
|
x = y = 0
|
|
¤Î¾ì¹ç¡¢
|
|
.It Ta
|
|
.Pf sign( Ar y Ns )*\\*(Pi/2 Ta
|
|
.Ar x
|
|
= 0 \(!=
|
|
.Ar y
|
|
¤Î¾ì¹ç
|
|
.El
|
|
.Sh Ãí
|
|
´Ø¿ô
|
|
.Fn atan2
|
|
¤Ï
|
|
.Tn VAX
|
|
¤Ç ``x > 0 ¤Î¾ì¹ç''¡¢
|
|
.Fn atan2 0 0
|
|
= 0
|
|
¤òÄêµÁ¤·¤Þ¤¹¡£°ÊÁ°¤Ï
|
|
.Fn atan2 0 0
|
|
¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÀ¸À®¤·¤Æ¤¤¤¿
|
|
²ÄǽÀ¤¬¤¢¤ë¤Ë¤â¤«¤«¤ï¤é¤º¤Ç¤¹¡£
|
|
.Fn atan2 0 0
|
|
¤ËÃͤò³ä¤êÅö¤Æ¤ëÍýͳ¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£
|
|
.Bl -enum -offset indent
|
|
.It
|
|
.Fn atan2 0 0
|
|
¤Î·×»»¤ò²óÈò¤¹¤ë¤¿¤á¤Ë°ú¿ô¤ò¥Æ¥¹¥È¤¹¤ë¥×¥í¥°¥é¥à¤Ï¡¢¤³¤ÎÃͤË
|
|
̵´Ø·¸¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤¬Ìµ¸ú¤Ç¤¢¤ë¤³¤È¤òÍ׵᤹¤ë¥×¥í¥°¥é¥à¤Ï¡¢
|
|
¤µ¤Þ¤¶¤Þ¤Ê¥³¥ó¥Ô¥å¡¼¥¿¥·¥¹¥Æ¥à¾å¤Ç¤³¤ì¤¬Ìµ¸ú¤Ç¤¢¤ë¤³¤È¤ËÂФ¹¤ë¤µ¤Þ¤¶¤Þ¤Ê
|
|
È¿±þ¤ËÂФ·Àȼå¤Ç¤¹¡£
|
|
.It
|
|
.Fn atan2
|
|
´Ø¿ô¤Ï¡¢¶ë·Á
|
|
(x,y)
|
|
¤ò¡¢¶ËºÂɸ
|
|
.if n\
|
|
(r,theta)
|
|
.if t\
|
|
(r,\(*h)
|
|
¤ËÊÑ´¹¤¹¤ë¤¿¤á¤ËºÇ¤âÎɤ¯»ÈÍѤµ¤ì¤Þ¤¹¡£¤³¤ÎºÂɸ¤Ï¡¢
|
|
.if n\
|
|
r\(**cos theta
|
|
.if t\
|
|
r\(**cos\(*h
|
|
¤ª¤è¤Ó
|
|
y =
|
|
.if n\
|
|
r\(**sin theta
|
|
.if t\
|
|
r\(**sin\(*h
|
|
¤òËþ¤¿¤·¤Þ¤¹¡£
|
|
.if n\
|
|
(r,theta)
|
|
.if t\
|
|
¤³¤ì¤é¤ÎÅù¼°¤¬
|
|
Ëþ¤¿¤µ¤ì¤ë¤Î¤Ï¡¢(x=0,y=0) ¤¬
|
|
.Tn VAX
|
|
¤Ç
|
|
.if n \
|
|
(r=0,theta=0)
|
|
.if t \
|
|
(r=0,\(*h=0)
|
|
¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¤È¤¤Ç¤¹¡£
|
|
°ìÈ̤ˡ¢¶ËºÂɸ¤Ø¤ÎÊÑ´¹¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æ·×»»¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
|
|
.Bd -unfilled -offset indent
|
|
.if n \{\
|
|
r := hypot(x,y); ... := sqrt(x\(**x+y\(**y)
|
|
theta := atan2(y,x)
|
|
.\}
|
|
.if t \{\
|
|
r := hypot(x,y); ... := \(sr(x\u\s82\s10\d+y\u\s82\s10\d)
|
|
theta := atan2(y,x)
|
|
.\}
|
|
.\"XX .XX sqrt x*x+y*y
|
|
.Ed
|
|
.It
|
|
¾åµ¤Î¸ø¼°¤Ï¡¢
|
|
.Tn IEEE 754
|
|
¤Ë½àµò¤¹¤ë¥Þ¥·¥ó¤Ç¤ÏÉ乿ÉÕ¤¤Î 0 ¤ª¤è¤Ó̵¸Â¤Ë¡¢
|
|
¹çÍýŪ¤ÊÊýË¡¤Ç¡¢Âн褷¤è¤¦¤ÈÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£¤½¤Î¤è¤¦¤Ê¥Þ¥·¥óÍѤË
|
|
Ä󶡤µ¤ì¤Æ¤¤¤ë
|
|
.Xr hypot 3
|
|
¤È
|
|
.Fn atan2
|
|
¤Ï¤¹¤Ù¤Æ¤Î¥±¡¼¥¹¤ò½èÍý¤¹¤ë¤è¤¦
|
|
À߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤¬¤¿¤È¤¨¤Ð
|
|
.Fn atan2 \(+-0 \-0
|
|
= \(+-\*(Pi
|
|
¤Ç¤¢¤ëÍýͳ¤Ç¤¹¡£°ìÈ̤ˡ¢
|
|
¾åµ¤Î¸ø¼°¤Ï¼¡¤Î¤â¤Î¤ÈƱÅù¤Ç¤¹¡£
|
|
.Bd -unfilled -offset indent
|
|
.if n \
|
|
r := sqrt(x\(**x+y\(**y); r =0 ¤Î¾ì¹ç¤Ï¡¢x := copysign(1,x);
|
|
.if t \
|
|
r := \(sr(x\(**x+y\(**y);\0\0 r =0 ¤Î¾ì¹ç¤Ï¡¢x := copysign(1,x);
|
|
.Ed
|
|
.El
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr acos 3 ,
|
|
.Xr asin 3 ,
|
|
.Xr atan 3 ,
|
|
.Xr cos 3 ,
|
|
.Xr cosh 3 ,
|
|
.Xr math 3 ,
|
|
.Xr sin 3 ,
|
|
.Xr sinh 3 ,
|
|
.Xr tan 3 ,
|
|
.Xr tanh 3
|
|
.Pp
|
|
.Sh µ¬³Ê
|
|
.Fn atan2
|
|
´Ø¿ô¤Ï
|
|
.St -isoC
|
|
¤ËŬ¹ç¤·¤Æ¤¤¤Þ¤¹¡£
|
|
.\"X kuma
|