C++ Complex 库 - Proj
描述
它是一个复数投影,返回复数 x 在黎曼球上的投影。 x 的投影是 x,除了复数无穷大,它被映射到具有 INFINITY 实部和虚部 0.0 或 -0.0(如果支持)的复数值,具体取决于 x 的虚部的符号。
声明
以下是 std::proj 的声明。
template<class T> complex<T> proj (const complex<T>& x);
C++11
template<class T> complex<T> proj (const complex<T>& x);
参数
x − 这是一个复数的值。
返回值
它返回复数 x 在 Riemann sphere 上的投影。
异常
none
示例
在下面的 std::proj 示例中。
#include <iostream>
#include <complex>
#include <limits>
int main () {
std::complex<double> mycomplex (std::numeric_limits<double>::infinity(),3.0);
std::cout << "The projection of " << mycomplex << " is " << std::proj(mycomplex)
<< '\n';
return 0;
}
示例输出应该是这样的 −
The projection of (inf,3) is (inf,0)

