Namespaces
Variants

casinf, casin, casinl

From cppreference.net
定义于头文件 <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 为实数或整数,则该宏调用对应的实数函数( asinf asin asinl )。若 z 为虚数,则该宏调用函数的对应实数版本 asinh ,实现公式 arcsin(iy) = i arsinh(y) ,且该宏的返回类型为虚数。

目录

参数

z - 复参数

返回值

若无错误发生,则返回 z 的复反正弦值,其取值范围在虚轴上无界,在实轴上位于区间 [−π/2; +π/2] 内。

错误和特殊情况的处理方式如同该操作通过 - I * casinh ( I * z ) 实现

注释

反正弦(或反正弦函数)是一个多值函数,需要在复平面上设置分支切割。按照惯例,分支切割被放置在实轴的线段 (-∞,-1) (1,∞) 上。

反正弦函数主值的数学定义为 arcsin z = - i ln( i z + 1-z 2
)

For any 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)); // 或 CMPLX(-2, -0.0)
    printf("casin(-2-0i) (分支切割的另一侧) = %f%+fi\n", creal(z2), cimag(z2));
    // 对于任意 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++ 文档 for asin