sin.3m
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3M 代码 · 共 172 行
3M
172 行
.TH sin 3m RISC.de Pi \" PI stuff sign.if n \\\\$2pi\\$1.if t \\\\$2\\(*p\\$1...ds up \fIulp\fR.ds nn \fINaN\fR.SH Namesin, cos, tan, asin, acos, atan, atan2 \- trigonometric functionsand their inverses.SH Syntax.nf.B #include <math.h>.PP.B double sin(\fIx\fP).B double \fIx\fP;.PP.B float fsin(\fIx\fP).B float \fIx\fP;.PP.B double cos(\fIx\fP).B double \fIx\fP;.PP.B float fcos(\fIx\fP).B float \fIx\fP;.PP.B double tan(\fIx\fP).B double \fIx\fP;.PP.B float ftan(\fIx\fP).B float \fIx\fP;.PP.B double asin(\fIx\fP).B double \fIx\fP;.PP.B float fasin(\fIx\fP).B float \fIx\fP;.PP.B double acos(\fIx\fP).B double \fIx\fP;.PP.B float facos(\fIx\fP).B float \fIx\fP;.PP.B double atan(\fIx\fP).B double \fIx\fP;.PP.B float fatan(\fIx\fP).B float \fIx\fP;.PP.B double atan2(\fIy,x\fP).B double \fIy,x\fP;.PP.B float fatan2(\fIy,x\fP).B float \fIy,x\fP;.fi.SH Description.NXR "sin subroutine".NXR "cos subroutine".NXR "tan subroutine".NXR "asin subroutine"The.PN sin , .PN cos ,and .PN tanfunctions return trigonometric functions of radian arguments.I xfor double data types. .PPThe.PN fsin ,.PN fcos ,and.PN ftanfunctions return trigonometric functions for float data types..PPThe.PN asinand.PN fasinfunctions return the arc sine in the range .Pi /2 \-to.Pi /2for double and float data types, respectively..PP.NXR "acos subroutine".NXR "atan subroutine".NXR "atan2 subroutine"The .PN acosand.PN facosfunctions return the arc cosine in the range 0 to.Pifor double and float data types, respectively..PPThe .PN atan and.PN fatanfunctions return the arc tangent in the range.Pi /2 \-to.Pi /2for double and float data types, respectively..PPThe .PN atan2and.PN fatan2functions return the arc tangent of.I y/xin the range.Pi \| \-to.Pi,using the signs of both arguments to determine the quadrant of the return valuefor double and float data types, respectively..SS Error (due to roundoff)When.I Pstands for the number stored in the computer in place of.Pi " = 3.14159 26535 89793 23846 26433 ... ."and "trig" stands for one of "sin", "cos" or "tan", thenthe expression "trig(\fIx\fP)" in a program actually produces an approximation to.Pi /P), trig(\fIx\fP\(**and "atrig(\fIx\fP)" approximates.Pi )\(**atrig(\fIx\fP). (P/The approximations are close..PP P differs from.Piby a fraction of an \*(up; the difference is apparent only if the argument.I xis huge, and even then the difference is likely to be swamped bythe uncertainty in.I x.Every trigonometric identity that does not involve.Piexplicitly is satisfied equally well regardless of whether.Pi . "P = "For example,.if n \sin(\fIx\fP)**2+cos(\fIx\fP)**2\0=\01.if t \sin\u\s62\s10\d(\fIx\fP)+cos\u\s62\s10\d(\fIx\fP)\0=\01and sin(2\fIx\fP)\0=\02\|sin(\fIx\fP)cos(\fIx\fP) to within a few \*(ups regardless of how big.I xis. Therefore, the difference between P and.Piis unlikely to effect scientific and engineering computations..SH Return ValuesAll the double functions return \*(nn if \*(nn is passed in..PPIf |\|x| > 1 then.PN asin(\fIx\fP) and.PN acos(\fIx\fP) will return the default quiet \*(nn..PPThe.PN atan2function defines.PN atan2(0,0) = \*(nn..SH See Alsohypot(3m), math(3m), sqrt(3m)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?