-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vertex.h
50 lines (38 loc) · 887 Bytes
/
Vertex.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
50
/**
* Define um vertice 3D
*/
#ifndef _vertex_h
#define _vertex_h
#define VX 0
#define VY 1
#define VZ 2
class Vertex {
public:
float x, y, z;
/** constructors */
Vertex();
Vertex(float x, float y, float z);
~Vertex();
/** operators */
Vertex operator+(Vertex &v);
Vertex operator-(Vertex &v);
Vertex operator*(Vertex &v);
Vertex operator*(float num);
Vertex operator+(float num);
Vertex operator-(float num);
// Vertex operator-(void);
Vertex & operator+=(Vertex &v);
Vertex & operator-=(Vertex &v);
void mult(float num);
void sum(float num);
void sub(float num);
float distance(Vertex* v2);
float horizontalDistance(Vertex* v2);
float inner_product(Vertex *v);
Vertex* directionVector(Vertex* coords);
float directionAngle(Vertex* coords);
void normalize();
/** debug */
void dump();
};
#endif