std::sin(std::complex)
STD::sin%28 std::Complex%29
Defined in header | | |
---|---|---|
template< class T > complex<T> sin( const complex<T>& z | | |
计算复值的复正弦z
...
参数
z | - | complex value |
---|
返回值
如果没有错误发生,则复正弦z
会被归还。
处理错误和特殊情况时,就好像操作是由-i *
std::sinh
(i*z)
,在哪里i
是想象中的单位。
注记
正弦是复平面上的一个完整函数,没有分支割集。正弦的数学定义是sin z=
艾兹
*。
2I
例
二次
#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";
}
二次
产出:
二次
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文档
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。