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

std::atan(std::complex)

Defined in header <complex>

?

?

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

?

(since C++11)

计算复值的复弧切线z.分支切割存在于间隔之外。-i;+i沿着想象的轴。

参数

z

-

complex value

返回值

复弧切线z在范围内-π/2;+π/2沿着想象的轴。

返回值

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

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

注记

逆切线%28或弧切%29是一个多值函数,需要在复平面上切一个分支。分支切割按惯例放置在虚轴的线段%28-∞i、-i%29和%28+i、+∞i%29处。逆正切主值的数学定义是:atan z=-

*。

我Ln%281-iz%29-IN%281+iz

二次

代码语言:javascript
复制
#include <iostream>
#include <complex>
#include <cmath>
int main()
{
    std::cout << std::fixed;
    std::complex<double> z1(0, 2);
    std::cout << "atan" << z1 << " = " << std::atan(z1) << '\n';
 
    std::complex<double> z2(-0.0, 2);
    std::cout << "atan" << z2 << " (the other side of the cut) = "
              << std::atan(z2) << '\n';
 
    std::complex<double> z3(0, INFINITY);
    std::cout << "2*atan" << z3 << " = " << 2.0*std::atan(z3) << '\n';
}

二次

产出:

二次

代码语言:javascript
复制
atan(0.000000,2.000000) = (1.570796,0.549306)
atan(-0.000000,2.000000) (the other side of the cut) = (-1.570796,0.549306)
2*atan(0.000000,inf) = (3.141593,0.000000)

二次

另见

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

computes arc sine of a complex number (arcsin(z)) (function template)

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

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

tan(std::complex)

computes tangent of a complex number (tan(z)) (function template)

atan

computes arc tangent (arctan(x)) (function)

atan(std::valarray)

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

c Catan文件

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com