Callable object computing a complex or a general Cayley-Dickson from a polar representation.
namespace eve
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>,
auto from_polar( T0 rho, T1 theta)
const noexcept;
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, kyosu::concepts::cayley_dickson C>,
auto from_polar( T0 rho, T1 theta, C iz)
const noexcept;
}
constexpr auto from_polar
Callable object computing a complex or a general Cayley-Dickson from a polar representation.
Definition: from_polar.hpp:80
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <array>
#include <iostream>
int main()
{
auto theta = eve::pio_3(eve::as<double>());
auto rho = 3.0;
std::cout << " <- theta = " << theta << std::endl;
std::cout << " <- rho = " << rho << std::endl;
std::cout <<
" -> " <<
from_polar(theta, rho) <<
"\n";
std::cout <<
" -> " <<
from_polar(theta, rho, iz0) <<
"\n";
std::cout <<
" -> " <<
from_polar(theta, rho, iz1) <<
"\n";
return 0;
}
constexpr auto sign
Computes tne normalized value z/abs(z) if z is not zero else 0.
Definition: sign.hpp:63
constexpr auto quaternion
Constructs a kyosu::quaternion_t instance.
Definition: to_quaternion.hpp:83
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:24
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27