名前空間
変種
操作

std::tan(std::complex)

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

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

目次

[編集]引数

z - 複素数の値

[編集]戻り値

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

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

[編集]ノート

正接は複素平面上の解析関数であり、分岐切断はありません。 正接は実部に関して πi の周期で周期的であり、実数線に沿って座標 (π(1/2 + n), 0) に位数 1 の極を持ちます。 しかし一般的な浮動小数点表現では π/2 を正確に表すことはできず、そのため極エラーが発生するような引数の値はありません。

正接の数学的な定義は tan z =
i(e-iz
-eiz
)
e-iz
+eiz
です。

[編集]

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

出力:

tan(1.000000,0.000000) = (1.557408,0.000000) ( tan(1) = 1.557408) tan(0.000000,1.000000) = (0.000000,0.761594) (tanh(1) = 0.761594)

[編集]関連項目

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