Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      csinf, csin, csinl

      From cppreference.com
      <c‎ |numeric‎ |complex
       
       
       
      Complex number arithmetic
      Types and the imaginary constant
      (C99)
      (C99)    
      (C11)
      (C99)
      Manipulation
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      Power and exponential functions
      (C99)
      (C99)
      (C99)
      (C99)
      Trigonometric functions
      (C99)
      csin
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      Hyperbolic functions
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
      (C99)
       
      Defined in header<complex.h>
      floatcomplex       csinf(floatcomplex z);
      (1)(since C99)
      doublecomplex      csin(doublecomplex z);
      (2)(since C99)
      longdoublecomplex csinl(longdoublecomplex z);
      (3)(since C99)
      Defined in header<tgmath.h>
      #define sin( z )
      (4)(since C99)
      1-3) Computes the complex sine ofz.
      4) Type-generic macro: Ifz 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

      [edit]Parameters

      z - complex argument

      [edit]Return value

      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)

      [edit]Notes

      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

      [edit]Example

      Run this code
      #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)

      [edit]References

      • C17 standard (ISO/IEC 9899:2018):
      • 7.3.5.5 The csin functions (p: 138-139)
      • 7.25 Type-generic math <tgmath.h> (p: 272-273)
      • G.7 Type-generic math <tgmath.h> (p: 397)
      • C11 standard (ISO/IEC 9899:2011):
      • 7.3.5.5 The csin functions (p: 191-192)
      • 7.25 Type-generic math <tgmath.h> (p: 373-375)
      • G.7 Type-generic math <tgmath.h> (p: 545)
      • C99 standard (ISO/IEC 9899:1999):
      • 7.3.5.5 The csin functions (p: 173)
      • 7.22 Type-generic math <tgmath.h> (p: 335-337)
      • G.7 Type-generic math <tgmath.h> (p: 480)

      [edit]See also

      (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]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/numeric/complex/csin&oldid=138914"

      [8]ページ先頭

      ©2009-2025 Movatter.jp