名前空間
変種
操作

csinf, csin, csinl

From cppreference.com
< c‎ | numeric‎ | complex
ヘッダー <complex.h> で定義
float complex       csinf( float complex z );
(1) (C99以降)
double complex      csin( double complex z );
(2) (C99以降)
long double complex csinl( long double complex z );
(3) (C99以降)
ヘッダー <tgmath.h> で定義
#define sin( z )
(4) (C99以降)
1-3) z の複素正弦を計算します。
4) 型汎用マクロ: z の型が long double complex の場合、csinl が呼び出されます。 z の型が double complex の場合、csin が呼び出されます。 z の型が float complex の場合、csinf が呼び出されます。 z が実数または整数である場合、マクロは対応する実数関数(sinfsinsinl)を呼び出します。 z が虚数である場合、マクロは関数 sinh の対応する実数バージョンを呼び出し、公式 sin(iy) = i ∙ sinh(y) を実装し、マクロの戻り値の型は虚数になります。

目次

[edit] パラメータ

z - 複素数引数

[edit] 戻り値

エラーが発生しない場合、z の複素正弦。

エラーおよび特殊ケースは、演算が -I * csinh(I*z) によって実装されているかのように処理されます。

[edit] 注記

正弦は複素平面上の整関数であり、枝切りは持ちません。

正弦の数学的定義は sin z =
eiz
-e-iz
2i
です。

[edit]

#include <stdio.h>
#include <math.h>
#include <complex.h>
 
int main(void)
{
    double complex z = csin(1);  // behaves like real sine along the real line
    printf("sin(1+0i) = %f%+fi ( sin(1)=%f)\n", creal(z), cimag(z), sin(1));
 
    double complex z2 = csin(I); // behaves like sinh along the imaginary line 
    printf("sin(0+1i) = %f%+fi (sinh(1)=%f)\n", creal(z2), cimag(z2), sinh(1));
}

出力

sin(1+0i) = 0.841471+0.000000i ( sin(1)=0.841471)
sin(0+1i) = 0.000000+1.175201i (sinh(1)=1.175201)

[edit] 参考文献

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

[edit] 関連項目

(C99)(C99)(C99)
複素コサインを計算する
(関数) [編集]
(C99)(C99)(C99)
複素タンジェントを計算する
(関数) [編集]
(C99)(C99)(C99)
複素アークサインを計算する
(関数) [編集]
(C99)(C99)
サインを計算する (sin(x))
(関数) [編集]
English 日本語 中文(简体) 中文(繁體)