Callable object computing a quaternion from its semipolar representation.
This function build quaternions in a way similar to the way polar builds complex numbers from a polar representation of an \(\mathbb{R}^2\) element.
the quaternion value.
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
auto rho = 2.0;
auto alpha = eve::pio_3(eve::as(rho));
auto theta1 = eve::pio_4(eve::as(rho));
auto theta2 = eve::pio_2(eve::as(rho));
std::cout << " <- rho " << rho << std::endl;
std::cout << " <- alpha " << alpha<< std::endl;
std::cout << " <- theta1 " << theta1<< std::endl;
std::cout << " <- theta2 " << theta2<< std::endl;
std::cout <<
" -> " <<
from_semipolar(rho, alpha, theta1, theta2) <<
"\n";
return 0;
}