The ccosh functions (C99) - ccosh, ccoshf, ccoshl

複素数の双曲線余弦 (cosh) を計算します.

ccosh (C99)

#include <complex.h>
double complex ccosh(
    double complex z
);

ccosh 関数は,z の複素数双曲線余弦を計算し,結果を double complex 型で返します.

ccoshf (C99)

#include <complex.h>
float complex ccoshf(
    float complex z
);

ccoshf 関数は,z の複素数双曲線余弦を計算し,結果を float complex 型で返します.

ccoshl (C99)

#include <complex.h>
long double complex ccoshl(
    long double complex z
);

ccoshl 関数は,z の複素数双曲線余弦を計算し,結果を long double complex 型で返します.

戻り値

  • 複素数双曲線余弦値

C言語サンプルプログラム

以下に ccosh 関数を使用して複素数逆余弦を求めるサンプルプログラムを示します.

/* header files */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>

/* main */
int main(void) {
    double complex z = 3.0 + 2.0 * I;
    double complex ccosh_z01, ccosh_z02;
    double re = creal(z);
    double im = cimag(z);

    /* 複素数双曲線余弦を求める */
    ccosh_z01 = ccosh(z);
    ccosh_z02 = cosh(re) * cos(im) + I * sinh(re) * sin(im);

    /* 表示 */
    printf("ccosh 関数で求めた値:   %.10f + %.10fi\n",
        creal(ccosh_z01), cimag(ccosh_z01));
    printf("数学的定義から求めた値: %.10f + %.10fi\n",
        creal(ccosh_z02), cimag(ccosh_z02));

    return EXIT_SUCCESS;
}

実行例

サンプルプログラムの実行結果は以下のようになります.

ccosh 関数で求めた値: -4.1896256910 + 9.1092278938i
数学的定義から求めた値: -4.1896256910 + 9.1092278938i