名前空間
変種
操作

std::cosh(std::complex)

提供: cppreference.com
< cpp‎ | numeric‎ | complex
 
 
 
 
ヘッダ <complex> で定義
template< class T >
complex<T> cosh( const complex<T>& z );
(C++11およびそれ以降)

複素数の値 z の複素数の双曲線余弦を計算します。

目次

[編集] 引数

z - 複素数の値

[編集] 戻り値

エラーが発生しなければ、 z の複素数の双曲線余弦が返されます。

[編集] エラー処理と特殊な値

Errors are reported consistent with math_errhandling

If the implementation supports IEEE floating-point arithmetic,

  • std::cosh(std::conj(z)) == std::conj(std::cosh(z))
  • std::cosh(z) == std::cosh(-z)
  • If z is (+0,+0), the result is (1,+0)
  • If z is (+0,+∞), the result is (NaN,±0) (the sign of the imaginary part is unspecified) and FE_INVALID is raised
  • If z is (+0,NaN), the result is (NaN,±0) (the sign of the imaginary part is unspecified)
  • If z is (x,+∞) (for any finite non-zero x), the result is (NaN,NaN) and FE_INVALID is raised
  • If z is (x,NaN) (for any finite non-zero x), the result is (NaN,NaN) and FE_INVALID may be raised
  • If z is (+∞,+0), the result is (+∞,+0)
  • If z is (+∞,y) (for any finite non-zero y), the result is +∞cis(y)
  • If z is (+∞,+∞), the result is (±∞,NaN) (the sign of the real part is unspecified) and FE_INVALID is raised
  • If z is (+∞,NaN), the result is (+∞,NaN)
  • If z is (NaN,+0), the result is (NaN,±0) (the sign of the imaginary part is unspecified)
  • If z is (NaN,+y) (for any finite non-zero y), the result is (NaN,NaN) and FE_INVALID may be raised
  • If z is (NaN,NaN), the result is (NaN,NaN)

where cis(y) is cos(y) + i sin(y)

[編集] ノート

双曲線余弦の数学的な定義は cosh z =
ez
+e-z
2
です。

双曲線余弦は複素平面上の整関数であり、分岐切断はありません。 双曲線余弦は虚部に関して 2πi の周期で周期的です。

[編集]

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

出力:

cosh(1.000000,0.000000) = (1.543081,0.000000) (cosh(1) = 1.543081)
cosh(0.000000,1.000000) = (0.540302,0.000000) ( cos(1) = 0.540302)

[編集] 関連項目

複素数の双曲線正弦 (sh(z)) を計算します
(関数テンプレート) [edit]
複素数の双曲線正接を計算します
(関数テンプレート) [edit]
複素数の逆双曲線余弦を計算します
(関数テンプレート) [edit]
双曲線余弦 (ch(x)) を計算します
(関数) [edit]
valarray の各要素に関数 std::cosh を適用します
(関数テンプレート) [edit]