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

◆ from_cylindrospherical

constexpr tags::callable_from_cylindrospherical kyosu::from_cylindrospherical = {}
inlineconstexpr

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>`

Callable Signatures

namespace eve
{
auto from_cylindrospherical(auto t, auto radius, auto longitude, auto latitude) const noexcept;
}
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;
std::cout << " -> " << from_cylindrospherical(radius, t, longitude, latitude) << "\n";
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>`

Callable Signatures

namespace eve
{
auto from_cylindrospherical(auto t, auto radius, auto longitude, auto latitude) const noexcept;
}

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;
std::cout << " -> " << from_cylindrospherical(radius, t, longitude, latitude) << "\n";
return 0;
}