Callable object computing a quaternion from its euler representation.
This function builds a quaternion from 3 euler angles in radian. Template parameters I, J, K of type int are used to choose the euler axis order.
for instance I = 3, J = 2, K = 3 choose the ZYZ sequence. the values of I, J, and K must be in {1, 2, 3} ans satisfy I != J && J != K.
#include kyosu/quaternion.hpp>`
namespace eve
{
template <
int I,
int J,
int K >
auto from_euler(
auto a,
auto b,
auto c
, axis<I> a1, axis<J> a2, axis<K> a3
) const noexcept;
requires(I != J && J != K)
template < int I, int J, int K > auto from_euler[extrinsic](auto a, auto b, auto c
, axis<I> a1, axis<J> a2, axis<K> a3
) const noexcept;
requires(I != J && J != K)
template < int I, int J, int K > auto from_euler[intrinsic](auto a, auto b, auto c
, axis<I> a1, axis<J> a2, axis<K> a3
) const noexcept;
requires(I != J && J != K)
}
}
constexpr auto from_euler
Callable object computing a quaternion from its euler representation.
Definition: from_euler.hpp:122
Parameters
a
, b
, c
: the angles in radian
a1
, a2
, a3
the axis parameters to be chosen between X_, Y_, Z_ (two consecutive axis cannot be the same)
Template parameters
- I, J, K: are on call deduced from the axis parameters
Return value
- quaternion representing the rotation. extrinsic rotation scheme is used
- Same but the intrinsic way is used to interpret the angles.
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::X_;
using kyosu::Z_;
using kyosu::Y_;
auto psi = eve::pio_3(eve::as(0.0));
auto theta= eve::pio_4(eve::as(0.0));
auto phi = eve::pio_6(eve::as(0.0));
std::cout << " <- psi " << psi << std::endl;
std::cout << " <- theta " << theta << std::endl;
std::cout << " <- phi " << phi<< std::endl;
std::cout << " -> from_euler(psi, theta, phi, X_, Z_, Y_) "
std::cout << " -> from_euler[intrinsic](psi, theta, phi, Y_, Z_, Y_) "
return 0;
}