kyosu v0.1.0
Complex Without Complexes
 
Loading...
Searching...
No Matches

◆ from_multipolar

kyosu::from_multipolar = {}
inlineconstexpr

Callable object computing a quaternion from its multipolar representation.

This function build quaternions in a way similar to the way polar builds complex numbers from a multipolar representation of an \(\mathbb{R}^4\) element.

from_multipolar the two \(\mathbb{C}\) components of the quaternion are given in polar coordinates

Defined in header

#include eve/module/quaternion.hpp>`

Callable Signatures

namespace eve
{
auto from_multipolar(auto rho1, auto theta1, auto rho2, auto theta2) noexcept;
}
constexpr tags::callable_from_multipolar from_multipolar
Callable object computing a quaternion from its multipolar representation.
Definition: from_multipolar.hpp:98

Parameters

rho1, rho2: the moduli

theta1, theta2: the angles in radian

Return value

the quaternion value


Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
auto r1 = 2.0;
auto t1 = eve::pio_3(eve::as(r1));
auto r2 = 3.0;
auto t2 = eve::pio_2(eve::as(r1));
std::cout << " <- r1 " << r1 << std::endl;
std::cout << " <- t1 " << t1<< std::endl;
std::cout << " <- r2 " << r2<< std::endl;
std::cout << " <- t2 " << t2<< std::endl;
std::cout << " -> " << from_multipolar(r1, t1, r2, t2) << "\n";
return 0;
}
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:27
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27