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

◆ from_cylindrospherical

auto kyosu::from_cylindrospherical = eve::functor<from_cylindrospherical_t>
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.

Header file

#include kyosu/quaternion.hpp>`

Callable Signatures

namespace eve
{
auto from_cylindrospherical(auto t, auto radius, auto longitude, auto latitude) const noexcept;
auto from_cylindrospherical[radpi](auto t, auto radius, auto longitude, auto latitude) const noexcept;
}
constexpr auto from_cylindrospherical
Callable object computing a quaternion from its cylindrospherical representation.
Definition from_cylindrospherical.hpp:73

Parameters

  • t, radius: the moduli
  • longitude, latitude: angles. If radpi is present they are assumed expressed in \(\pi\) multiples else in radian.

Return value

the quaternion value


Example

#include <eve/wide.hpp>
#include <iostream>
#include <kyosu/kyosu.hpp>
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:24

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.

Header file

#include kyosu/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 <eve/wide.hpp>
#include <iostream>
#include <kyosu/kyosu.hpp>
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;
}