首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::asin(std::complex)

Defined in header <complex>

template< class T > complex<T> asin( const complex<T>& z );

(since C++11)

计算复值的复弧正弦z.分支切割存在于间隔之外。-1;+1沿着真正的轴线。

参数

z

-

complex value

返回值

如果没有错误发生,则复弧正弦z返回,在沿假想轴和间隔无界的条带范围内返回。-π/2;+π/2沿着真正的轴线。

处理错误和特殊情况时,就好像操作是由-i *std::asinh(i*z),在哪里i是想象中的单位。

注记

逆正弦%28或弧正弦%29是一个多值函数,需要在复平面上进行分支切割。分支切割按惯例放置在实际轴的线段%28-∞,-1%29和%281,∞%29处。

弧正弦主值的数学定义为:Asin z=-i_ln%28_i_z+seari_z2

%29对于任何z,asin%28 z%29=acos%28-z%29-

π

*。

二次

代码语言:javascript
复制
#include <iostream>
#include <cmath>
#include <complex>
 
int main()
{
    std::cout << std::fixed;
    std::complex<double> z1(-2, 0);
    std::cout << "acos" << z1 << " = " << std::acos(z1) << '\n';
 
    std::complex<double> z2(-2, -0.0);
    std::cout << "acos" << z2 << " (the other side of the cut) = "
              << std::acos(z2) << '\n';
 
    // for any z, acos(z) = pi - acos(-z)
    const double pi = std::acos(-1);
    std::complex<double> z3 = pi - std::acos(z2);
    std::cout << "cos(pi - acos" << z2 << ") = " << std::cos(z3) << '\n';
}

二次

产出:

二次

代码语言:javascript
复制
asin(-2.000000,0.000000) = (-1.570796,1.316958)
asin(-2.000000,-0.000000) (the other side of the cut) = (-1.570796,-1.316958)
sin(acos(-2.000000,-0.000000) - pi/2) = (-2.000000,-0.000000)

二次

另见

acos(std::complex) (C++11)

computes arc cosine of a complex number (arccos(z)) (function template)

atan(std::complex) (C++11)

computes arc tangent of a complex number (arctan(z)) (function template)

sin(std::complex)

computes sine of a complex number (sin(z)) (function template)

asin

computes arc sine (arcsin(x)) (function)

asin(std::valarray)

applies the function std::asin to each element of valarray (function template)

C为Casin编写的文件

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券