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

std::sin(std::complex)

Defined in header <complex>

?

?

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

?

?

计算复值的复正弦z...

参数

z

-

complex value

返回值

如果没有错误发生,则复正弦z会被归还。

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

注记

正弦是复平面上的一个完整函数,没有分支割集。正弦的数学定义是sin z=

艾兹

*。

2I

二次

代码语言:javascript
复制
#include <iostream>
#include <cmath>
#include <complex>
 
int main()
{
    std::cout << std::fixed;
    std::complex<double> z(1, 0); // behaves like real sine along the real line
    std::cout << "sin" << z << " = " << std::sin(z)
              << " ( sin(1) = " << std::sin(1) << ")\n";
 
    std::complex<double> z2(0, 1); // behaves like sinh along the imaginary line
    std::cout << "sin" << z2 << " = " << std::sin(z2)
              << " (sinh(1) = " << std::sinh(1) << ")\n";
}

二次

产出:

二次

代码语言:javascript
复制
sin(1.000000,0.000000) = (0.841471,0.000000) ( sin(1) = 0.841471)
sin(0.000000,1.000000) = (0.000000,1.175201) (sinh(1) = 1.175201)

二次

另见

cos(std::complex)

computes cosine of a complex number (cos(z)) (function template)

tan(std::complex)

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

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

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

sin

computes sine (sin(x)) (function)

sin(std::valarray)

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

csin文档

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com