proj - C complex.h

C examples for complex.h:proj

type

function template

From


<complex>
<complex.h>

Prototype

template<class T> 
complex<T> proj (const complex<T>& x);
complex<double> conj (ArithmeticType x);

Description

Complex projection.

Returns the projection of the complex number x onto the Riemann sphere.

Parameters

Parameter Description
x Complex value.

Return value

Complex projection of x onto the Riemann sphere.

Demo Code

#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;
}

Related Tutorials