14 using namespace std::literals::complex_literals;
15 std::complex<double> z = 3. + 4.i;
17 std::cout <<
"real part:" << std::real(z) << std::endl;
18 std::cout <<
"imaginary part:" << std::imag(z) << std::endl;
20 std::cout <<
"absolute value:" << std::abs(z) << std::endl;
21 std::cout <<
"phase angle:" << std::arg(z) << std::endl;
22 std::cout <<
"norm:" << std::norm(z) << std::endl;
24 std::cout <<
"complex conjugate:" << std::conj(z) << std::endl;
25 std::cout <<
"polar component:" << std::polar(5., 0.927295) << std::endl;
32 using namespace std::literals::complex_literals;
33 std::complex<double> z1 = 3. + 4i, z2 = 2. - 5i;
34 std::cout <<
"z1=" << z1 <<
", z2=" << z2 << std::endl;
36 std::cout <<
"z1+z2=" << z1 + z2 << std::endl;
37 std::cout <<
"z1-z2=" << z1 - z2 << std::endl;
39 std::cout <<
"z1+conj(z2)=" << z1 + std::conj(z2) << std::endl;
40 std::cout <<
"z1-conj(z2)=" << z1 - std::conj(z2) << std::endl;
42 std::cout <<
"z1/z2=" << z1 / z2 << std::endl;
43 std::cout <<
"z1^3+z2^2=" << std::pow(z1, 3) * std::pow(z2, 2) << std::endl;
void ex1()
ex1 Eigenschaften von komplexen Zahlen
void ex2()
ex2 Rechnen mit komplexen Zahlen