-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathQuater.h
49 lines (32 loc) · 877 Bytes
/
Quater.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef QUATERNION_H
#define QUATERNION_H
#include <opencv2/opencv.hpp>
#include "opencv/cv.h"
#include <math.h>
const double Pi = 3.14159265358979323846;
const double Epsilon = 1e-5;
using namespace cv;
using namespace std;
class Quater
{
public:
Quater( double _x, double _y, double _z, double _w );
Quater();
double X() { return x; }
void set_X( double a ) { x = a; }
double Y() { return y; }
void set_Y( double a ) { y = a; }
double Z() { return z; }
void set_Z( double a ) { z = a; }
double W() { return w; }
void set_W( double a ) { w = a; }
void Normalize();
void Invert();
Point3d RotateVectorByQuaternion( Point3d v );
Point3d Quaternions( Mat rotationMat, Point3d point );
void Quaternions( Mat rotationMat );
private:
double x, y, z, w;
void Conjugate();
};
#endif