#include <pw/core/quaternion.hpp>
#include <pw/core/serialize.hpp>

#include <iostream>

int main(int argc,char **argv) {

    pw::quaternion<float> qf = pw::quaternionf::rotate_90_degree_around_x();

    std::cout << "qf = " << pw::serialize::matrix(qf.as_vector()) << std::endl;
    std::cout << "qf.matrix() = " << pw::serialize::matrix(qf.to_matrix()) << std::endl;

    std::cout << "qf.squared_norm() = " << qf.squared_norm() << std::endl;
    std::cout << "qf.dot(qf) = " << qf.dot(qf) << std::endl;
    std::cout << "qf.conjugate() = " << pw::serialize::matrix(qf.conjugate().as_vector()) << std::endl;

    pw::quaternionf qi = qf.inverse();
    std::cout << "qf.inverse() (qi) = " << pw::serialize::matrix(qi.as_vector()) << std::endl;


    pw::quaternionf qmid = pw::quaternionf::normalized_lerp(qi,qf,0.5f);

    std::cout << "qmid.dot() (half between qf and qi) = " << pw::rad_to_deg(std::acos(qmid.dot(qf))) << std::endl;





    return 0;
}
