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

◆ to_cylindrospherical

kyosu::to_cylindrospherical = {}
inlineconstexpr

Callable object computing the cylindrospherical coordinates from a quaternion.

This function is the reciprocal of from_cylindrospherical.

Defined in header

#include eve/module/quaternion.hpp>`

Callable Signatures

namespace eve
{
auto to_cylindrospherical(auto q) const noexcept;
}
constexpr tags::callable_to_cylindrospherical to_cylindrospherical
Callable object computing the cylindrospherical coordinates from a quaternion.
Definition: to_cylindrospherical.hpp:86

Parameters

q: quaternion

Return value

a tuple containing in this order t, radius, longitude latitude: the components of the cylindrospherical parametrisation of \(\mathbb{R}^4\) coordinates


Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using e_t = float;
using we_t = eve::wide<float, eve::fixed<2>>;
using wc_t = eve::wide<kyosu::complex_t<float>, eve::fixed<2>>;
using wq_t = eve::wide<kyosu::quaternion_t<float>, eve::fixed<2>>;
std::cout << "Real: "<< "\n";
e_t e0(1);
std::cout << e0 << " -> " << to_cylindrospherical(e0) << "\n";
we_t we0(e0);
std::cout << we0 << " -> " << to_cylindrospherical(we0) << "\n";
std::cout << "Complex: "<< "\n";
c_t c0(1, 5);
std::cout << c0 << " -> " << to_cylindrospherical(c0) << "\n";
wc_t wc0(c0);
std::cout << wc0 << " -> " << to_cylindrospherical(wc0) << "\n";
std::cout << "Quaternion: "<< "\n";
q_t q0(1, 5, 2, 3);
std::cout << q0 << " -> " << to_cylindrospherical(q0) << "\n";
wq_t wq0(q0);
std::cout << wq0 << " -> " << to_cylindrospherical(wq0) << "\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