2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL, 2002-07-27 Walter Harms
|
2008-08-01 05:26:44 +00:00
|
|
|
.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
|
|
|
|
.\" <mtk.manpages@gmail.com>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
2008-08-11 17:13:47 +00:00
|
|
|
.TH SINCOS 3 2008-08-11 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
sincos, sincosf, sincosl \- calculate sin and cos simultaneously
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
2004-11-15 13:11:26 +00:00
|
|
|
.B #define _GNU_SOURCE
|
2004-11-03 13:51:07 +00:00
|
|
|
.B #include <math.h>
|
|
|
|
.sp
|
|
|
|
.BI "void sincos(double " x ", double *" sin ", double *" cos );
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "void sincosf(float " x ", float *" sin ", float *" cos );
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
|
|
|
|
.fi
|
|
|
|
.sp
|
2007-07-21 05:25:03 +00:00
|
|
|
Link with \fI\-lm\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
Several applications need sine and cosine of the same angle
|
|
|
|
.IR x .
|
2008-08-01 05:26:44 +00:00
|
|
|
This function computes both at the same time, and stores the results in
|
|
|
|
.I *sin
|
|
|
|
and
|
|
|
|
.IR *cos .
|
|
|
|
|
|
|
|
If
|
|
|
|
.I x
|
|
|
|
is a NaN,
|
|
|
|
a NaN is returned in
|
|
|
|
.I *sin
|
|
|
|
and
|
|
|
|
.IR *cos .
|
|
|
|
|
|
|
|
If
|
|
|
|
.I x
|
|
|
|
is positive infinity or negative infinity,
|
2008-08-04 16:00:58 +00:00
|
|
|
a domain error occurs, and
|
2008-08-01 05:26:44 +00:00
|
|
|
a NaN is returned in
|
|
|
|
.I *sin
|
|
|
|
and
|
|
|
|
.IR *cos .
|
|
|
|
.SH RETURN VALUE
|
|
|
|
These functions return
|
|
|
|
.IR void .
|
|
|
|
.SH ERRORS
|
|
|
|
See
|
|
|
|
.BR math_error (7)
|
|
|
|
for information on how to determine whether an error has occurred
|
|
|
|
when calling these functions.
|
|
|
|
.PP
|
|
|
|
The following errors can occur:
|
|
|
|
.TP
|
|
|
|
Domain error: \fIx\fP is an infinity
|
|
|
|
.\" .I errno
|
|
|
|
.\" is set to
|
|
|
|
.\" .BR EDOM .
|
|
|
|
An invalid floating-point exception
|
|
|
|
.RB ( FE_INVALID )
|
|
|
|
is raised.
|
|
|
|
.PP
|
|
|
|
These functions do not set
|
|
|
|
.IR errno .
|
|
|
|
.\" FIXME . Is it intentional that these functions do not set errno?
|
|
|
|
.\" sin() and cos() also don't set errno; bugs have been raised for
|
|
|
|
.\" those functions.
|
2008-08-11 17:13:47 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
These functions first appeared in glibc in version 2.1.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
This function is a GNU extension.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR cos (3),
|
|
|
|
.BR sin (3),
|
2007-01-28 20:00:24 +00:00
|
|
|
.BR tan (3),
|
|
|
|
.BR feature_test_macros (7)
|