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

◆ from_cylindrical

kyosu::from_cylindrical = {}
inlineconstexpr

Callable object computing a quaternion from its cylindrical representation.

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

from_cylindrical first two inputs are the polar coordinates of the first \(\mathbb{C}\) component of the quaternion. The third and fourth inputs are placed into the third and fourth \(\mathbb{R}\) components of the quaternion, respectively.

Defined in header

#include kyosu/module/quaternion.hpp>`

Callable Signatures

namespace kyosu
{
auto from_cylindrical(auto r, auto angle, auto h1, auto h2) const noexcept;
}
constexpr tags::callable_from_cylindrical from_cylindrical
Callable object computing a quaternion from its cylindrical representation.
Definition: from_cylindrical.hpp:95
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • r, angle, h1, h2

Return value

the quaternion value.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
auto r = 2.0;
auto a = eve::pio_3(eve::as(r));
auto h1 = 3.0;
auto h2 = 4.0;
std::cout << " <- modulus " << r << std::endl;
std::cout << " <- angle " << a << std::endl;
std::cout << " <- h1 " << h1<< std::endl;
std::cout << " <- h2 " << h2<< std::endl;
std::cout << " -> " << from_cylindrical(r, a, h1, h2) << "\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