名前空間
変種
操作

std::sin(std::complex)

提供: cppreference.com
< cpp‎ | numeric‎ | complex
 
 
 
 
ヘッダ <complex> で定義
template< class T >
complex<T> sin( const complex<T>& z );

複素数の値 z の複素正弦を計算します。

目次

[編集] 引数

z - 複素数の値

[編集] 戻り値

エラーが発生しなければ、 z の複素正弦を返します。

エラーおよび特殊なケースは、この演算が -i * std::sinh(i*z) によって実装されているかのように処理されます。 ただし i は虚数単位です。

[編集] ノート

正弦は複素平面上の整関数であり、分岐切断はありません。

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

[編集]

#include <iostream>
#include <cmath>
#include <complex>
 
int main()
{
    std::cout << std::fixed;
    std::complex<double> z(1, 0); // behaves like real sine along the real line
    std::cout << "sin" << z << " = " << std::sin(z)
              << " ( sin(1) = " << std::sin(1) << ")\n";
 
    std::complex<double> z2(0, 1); // behaves like sinh along the imaginary line
    std::cout << "sin" << z2 << " = " << std::sin(z2)
              << " (sinh(1) = " << std::sinh(1) << ")\n";
}

出力:

sin(1.000000,0.000000) = (0.841471,0.000000) ( sin(1) = 0.841471)
sin(0.000000,1.000000) = (0.000000,1.175201) (sinh(1) = 1.175201)

[編集] 関連項目

複素数の余弦 (cos(z)) を計算します
(関数テンプレート) [edit]
複素数の正接 (tan(z)) を計算します
(関数テンプレート) [edit]
複素数の逆正弦 (arcsin(z)) を計算します
(関数テンプレート) [edit]
(C++11)(C++11)
正弦 (sin(x)) を計算します
(関数) [edit]
valarray の各要素に関数 std::sin を適用します
(関数テンプレート) [edit]