Cpp-standard-library-cpp-complex-proj

提供:Dev Guides
移動先:案内検索

C ++複雑なライブラリ-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のリーマン球への射影を返します。

例外

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)