#include "qvm.h"
int main(int argc, char** argv)
{
QVM::quat q1, q2(1.,2.,3.,4.), q3(5.,6.,7.,8.);
QVM::quat q4(q2);
std::cout << "q1 = " << q1 << std::endl;
std::cout << "q2 = " << q2 << std::endl;
std::cout << "q3 = " << q3 << std::endl;
std::cout << "q4 = " << q4 << std::endl;
std::cout << "q2+q3 = " << q2+q3 << std::endl;
std::cout << "q2-q3 = " << q2-q3 << std::endl;
std::cout << "q2*q3 = " << q2*q3 << std::endl;
std::cout << "q2/q3 = " << q2/q3 << std::endl;
std::cout << "10.*q3 = " << 10.*q3 << std::endl;
std::cout << "q3*10. = " << q3*10. << std::endl;
q2+=q3;
std::cout << "after q2+=q3, q2 = " << q2 << std::endl;
q2-=q3;
std::cout << "after q2-=q3, q2 = " << q2 << std::endl;
q2*=q3;
std::cout << "after q2*=q3, q2 = " << q2 << std::endl;
q2/=q3;
std::cout << "after q2/=q3, q2 = " << q2 << std::endl;
q2*=10.;
std::cout << "after q2*=10., q2 = " << q2 << std::endl;
q2/=10.;
std::cout << "after q2/=10., q2 = " << q2 << std::endl;
std::cout << "abs(q2) = " << abs(q2) << std::endl;
std::cout << "norm(q2) = " << norm(q2) << std::endl;
q2.normalize();
std::cout << "after q2.normalize(), q2 = " << q2 << std::endl;
std::cout << "conj(q2) = " << conj(q2) << std::endl;
swap(q2,q3);
std::cout << "after swap(q2,q3),\n q2 = " << q2
<< " q3 = " << q3 << std::endl;
return 0;
}
#include "qvm.h"
int main(int argc, char** argv)
{
QVM::vec v1, v2(1.,2.,3.), v3(2.,3.,4.);
QVM::vec v4(-v2);
std::cout << "v1 = " << v1 << std::endl;
std::cout << "v2 = " << v2 << std::endl;
std::cout << "v3 = " << v3 << std::endl;
std::cout << "v4 = " << v4 << std::endl;
std::cout << "v2+v3 = " << v2+v3 << std::endl;
std::cout << "v2-v3 = " << v2-v3 << std::endl;
std::cout << "v2*v3 = " << v2*v3 << std::endl;
std::cout << "v2/v3 = " << v2/v3 << std::endl;
std::cout << "v2%v3 = " << v2%v3 << std::endl;
std::cout << "10.*v2 = " << 10.*v2 << std::endl;
std::cout << "v2*10. = " << v2*10. << std::endl;
v2+=v3;
std::cout << "after v2+=v3, v2 = " << v2 << std::endl;
v2-=v3;
std::cout << "after v2-=v3, v2 = " << v2 << std::endl;
v2/=v3;
std::cout << "after v2/=v3, v2 = " << v2 << std::endl;
v2*=10.;
std::cout << "after v2*=10., v2 = " << v2 << std::endl;
v2/=10.;
std::cout << "after v2/=10., v2 = " << v2 << std::endl;
std::cout << "abs(v2) = " << abs(v2) << std::endl;
std::cout << "norm(v2) = " << norm(v2) << std::endl;
v2.normalize();
std::cout << "after v2.normalize(), v2 = " << v2 << std::endl;
swap(v2,v3);
std::cout << "after swap(v2,v3),\n v2 = " << v2
<< " v3 = " << v3 << std::endl;
return 0;
}
#include "qvm.h"
int main(int argc, char** argv)
{
QVM::mat m1, m2(11.,12.,13.,21.,22.,23.,31.,32.,33.),
m3(0.,6.,9.,4.,1.,1.,4.,8.,4.);
QVM::mat m4(-m2);
std::cout << "m1 = " << m1 << std::endl;
std::cout << "m2 = " << m2 << std::endl;
std::cout << "m3 = " << m3 << std::endl;
std::cout << "m4 = " << m4 << std::endl;
std::cout << "m2+m3 = " << m2+m3 << std::endl;
std::cout << "m2-m3 = " << m2-m3 << std::endl;
std::cout << "m2*m3 = " << m2*m3 << std::endl;
std::cout << "10.*m2 = " << 10.*m2 << std::endl;
std::cout << "m2*10. = " << m2*10. << std::endl;
m2+=m3;
std::cout << "after m2+=m3, m2 = " << m2 << std::endl;
m2-=m3;
std::cout << "after m2-=m3, m2 = " << m2 << std::endl;
m2*=m3;
std::cout << "after m2*=m3, m2 = " << m2 << std::endl;
m2*=inv(m3);
std::cout << "after m2*=inv(m3), m2 = " << m2 << std::endl;
m2*=10.;
std::cout << "after m2*=10., m2 = " << m2 << std::endl;
m2/=10.;
std::cout << "after m2/=10., m2 = " << m2 << std::endl;
std::cout << "det(m3) = " << det(m3) << std::endl;
std::cout << "inv(m3) = " << inv(m3) << std::endl;
swap(m2,m3);
std::cout << "after swap(m2,m3),\n m2 = " << m2
<< " m3 = " << m3 << std::endl;
return 0;
}