| Types and the imaginary constant | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Manipulation | |||||||||||||||||||||||||||||||
| Power and exponential functions | |||||||||||||||||||||||||||||||
| Trigonometric functions | |||||||||||||||||||||||||||||||
| Hyperbolic functions | |||||||||||||||||||||||||||||||
Defined in header <complex.h> | ||
| (1) | (since C99) | |
| (2) | (since C99) | |
| (3) | (since C99) | |
Defined in header <tgmath.h> | ||
#define sin( z ) | (4) | (since C99) |
z.z has typelongdoublecomplex,csinl is called. ifz has typedoublecomplex,csin is called, ifz has typefloatcomplex,csinf is called. Ifz is real or integer, then the macro invokes the corresponding real function (sinf,sin,sinl). Ifz is imaginary, then the macro invokes the corresponding real version of the functionsinh, implementing the formulasin(iy) = i ∙ sinh(y), and the return type of the macro is imaginary.Contents |
| z | - | complex argument |
If no errors occur, the complex sine ofz.
Errors and special cases are handled as if the operation is implemented by-I*csinh(I*z)
The sine is an entire function on the complex plane, and has no branch cuts.
Mathematical definition of the sine issin z =| eiz -e-iz |
| 2i |
#include <stdio.h>#include <math.h>#include <complex.h> int main(void){doublecomplex z= csin(1);// behaves like real sine along the real lineprintf("sin(1+0i) = %f%+fi ( sin(1)=%f)\n",creal(z),cimag(z),sin(1)); doublecomplex z2= csin(I);// behaves like sinh along the imaginary lineprintf("sin(0+1i) = %f%+fi (sinh(1)=%f)\n",creal(z2),cimag(z2),sinh(1));}
Output:
sin(1+0i) = 0.841471+0.000000i ( sin(1)=0.841471)sin(0+1i) = 0.000000+1.175201i (sinh(1)=1.175201)
(C99)(C99)(C99) | computes the complex cosine (function)[edit] |
(C99)(C99)(C99) | computes the complex tangent (function)[edit] |
(C99)(C99)(C99) | computes the complex arc sine (function)[edit] |
(C99)(C99) | computes sine (\({\small\sin{x} }\)sin(x)) (function)[edit] |
C++ documentation forsin | |