Callable object computing a quaternion from its cylindrospherical representation.
cylindrospherical is specific to quaternions. It is often interesting to consider \(\mathbb{H}\) as the cartesian product of \(\mathbb{R}\) by \(\mathbb{R}^3\) (the quaternionic multiplication has then a special form, as given here). This function therefore builds a quaternion from this representation, with the \(\mathbb{R}^3\) component given in usual \(\mathbb{R}^3\) spherical coordinates.
Defined in header
#include eve/module/quaternion.hpp>`
namespace eve
{
}
constexpr tags::callable_from_cylindrospherical from_cylindrospherical
Callable object computing a quaternion from its cylindrospherical representation.
Definition: from_cylindricospherical.hpp:98
Parameters
t
, radius
: the moduli
longitude
, latitude
: angles in radian
Return value
the quaternion value
Example
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
auto radius = 2.0;
auto t = eve::pio_3(eve::as(radius));
auto longitude = eve::pio_4(eve::as(radius));
auto latitude = eve::pio_2(eve::as(radius));
std::cout << " <- radius " << radius << std::endl;
std::cout << " <- t " << t << std::endl;
std::cout << " <- longitude " << longitude << std::endl;
std::cout << " <- latitude " << latitude << std::endl;
return 0;
}
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:27
cylindrospherical is specific to quaternions. It is often interesting to consider \(\mathbb{H}\) as the cartesian product of \(\mathbb{R}\) by \(\mathbb{R3}\) (the quaternionic multiplication has then a special form, as given here). This function therefore builds a quaternion from this representation, with the \(\mathbb{R3}\) component given in usual \(\mathbb{R3}\) spherical coordinates.
Defined in header
#include eve/module/quaternion.hpp>`
Parameters
t
, radius
: the moduli
longitude
, latitude
: angles in radian
Return value
the quaternion value
Example
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
auto radius = 2.0;
auto t = eve::pio_3(eve::as(radius));
auto longitude = eve::pio_4(eve::as(radius));
auto latitude = eve::pio_2(eve::as(radius));
std::cout << " <- radius " << radius << std::endl;
std::cout << " <- t " << t << std::endl;
std::cout << " <- longitude " << longitude << std::endl;
std::cout << " <- latitude " << latitude << std::endl;
return 0;
}