名稱空間
變體
操作

casinf, casin, casinl

來自 cppreference.com
< c‎ | 數值‎ | 複數
定義在標頭檔案 <complex.h>
float complex       casinf( float complex z );
(1) (C99 起)
double complex      casin( double complex z );
(2) (C99 起)
long double complex casinl( long double complex z );
(3) (C99 起)
定義於標頭檔案 <tgmath.h>
#define asin( z )
(4) (C99 起)
1-3) 計算 `z` 的複數反正弦,分支切割在實軸上區間 [−1,+1] 之外。
4) 型別通用宏:如果 `z` 的型別是 long double complex,則呼叫 `casinl`。如果 `z` 的型別是 double complex,則呼叫 `casin`。如果 `z` 的型別是 float complex,則呼叫 `casinf`。如果 `z` 是實數或整數,則宏呼叫對應的實數函式(asinfasinasinl)。如果 `z` 是虛數,則宏呼叫函式 asinh 的對應實數版本,實現公式 arcsin(iy) = i arsinh(y),並且宏的返回型別是虛數。

目錄

[編輯] 引數

z - 複數引數

[編輯] 返回值

如果未發生錯誤,則返回 `z` 的複數反正弦,範圍在沿虛軸無界的條帶內,沿實軸在區間 [−π/2; +π/2] 內。

錯誤和特殊情況的處理方式如同操作由 -I * casinh(I*z) 實現。

[編輯] 注意

反正弦是多值函式,需要在複平面上進行分支切割。分支切割通常放置在實軸的線段 (-∞,-1)(1,∞) 處。

反正弦主值的數學定義是 arcsin z = -iln(iz + 1-z2
)

對於任何 z,arcsin(z) = acos(-z) -
π
2

[編輯] 示例

#include <stdio.h>
#include <math.h>
#include <complex.h>
 
int main(void)
{
    double complex z = casin(-2);
    printf("casin(-2+0i) = %f%+fi\n", creal(z), cimag(z));
 
    double complex z2 = casin(conj(-2)); // or CMPLX(-2, -0.0)
    printf("casin(-2-0i) (the other side of the cut) = %f%+fi\n", creal(z2), cimag(z2));
 
    // for any z, asin(z) = acos(-z) - pi/2
    double pi = acos(-1);
    double complex z3 = csin(cacos(conj(-2))-pi/2);
    printf("csin(cacos(-2-0i)-pi/2) = %f%+fi\n", creal(z3), cimag(z3));
}

輸出

casin(-2+0i) = -1.570796+1.316958i
casin(-2-0i) (the other side of the cut) = -1.570796-1.316958i
csin(cacos(-2-0i)-pi/2) = 2.000000+0.000000i

[編輯] 參考

  • C11 標準 (ISO/IEC 9899:2011)
  • 7.3.5.2 casin 函式 (p: 190)
  • 7.25 型別通用數學 <tgmath.h> (p: 373-375)
  • G.7 型別通用數學 <tgmath.h> (p: 545)
  • C99 標準 (ISO/IEC 9899:1999)
  • 7.3.5.2 casin 函式 (p: 172)
  • 7.22 型別通用數學 <tgmath.h> (p: 335-337)
  • G.7 型別通用數學 <tgmath.h> (p: 480)

[編輯] 另請參見

(C99)(C99)(C99)
計算復反餘弦
(函式) [編輯]
(C99)(C99)(C99)
計算復反正切
(函式) [編輯]
(C99)(C99)(C99)
計算復正弦
(函式) [編輯]
(C99)(C99)
計算反正弦 (arcsin(x))
(函式) [編輯]
C++ 文件 用於 asin