1 #ifndef QNANO_NEW_QUATERNION_DEFINED_H 2 #define QNANO_NEW_QUATERNION_DEFINED_H 8 #include <tools/Vec3d.h> 14 double& operator[] (
size_t i) {
return u[i];}
15 const double& operator[] (
size_t i)
const {
return u[i];}
19 void set(
double ur=1,
double ux=0,
double uy=0,
double uz=0){
20 u[0]=ur; u[1]=ux; u[2]=uy; u[3]=uz;
22 inline double norm2()
const{
23 return (u[0]*u[0]+u[1]*u[1]+u[2]*u[2]+u[3]*u[3]);
28 std::vector<std::vector<double> > RotMat()
const;
31 Quaternion(
double ur=1,
double ux=0,
double uy=0,
double uz=0){
32 u[0]=ur; u[1]=ux; u[2]=uy; u[3]=uz;
36 std::cerr<<
"Contructing Quaternion from double vector: vector needs to have 4 elements!"<<std::endl;
Definition: Quaternion.h:10
Class to store positions and to handle operations on 3d vectors.
Definition: Vec3d.h:9