C examples for complex.h:proj
function template
<complex> <complex.h>
template<class T> complex<T> proj (const complex<T>& x); complex<double> conj (ArithmeticType x);
Complex projection.
Returns the projection of the complex number x onto the Riemann sphere.
Parameter | Description |
---|---|
x | Complex value. |
Complex projection of x onto the Riemann sphere.
#include <iostream> // std::cout #include <complex> // std::complex, std::proj #include <limits> // std::numeric_limits int main ()//from ww w . j av a2 s . co m { std::complex<double> mycomplex (std::numeric_limits<double>::infinity(),2.0); std::cout << "The projection of " << mycomplex << " is " << std::proj(mycomplex) << '\n'; return 0; }