-
Notifications
You must be signed in to change notification settings - Fork 0
/
Definition.h
executable file
·41 lines (26 loc) · 1.01 KB
/
Definition.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
#ifndef __DEF_H
#define __DEF_H
//a point with three float numbers indicating its location in 3d world
struct point {
float x, y, z;
};
//color structure with three float numbers indicating values
struct color {
float red, green, blue;
};
//a 3d vector with three float numbers indicating its values in three dimentions
struct vector3d {
float x, y, z;
};
point operator + (const point&p, const vector3d &v);
point operator - (const point&p, const vector3d &v);
vector3d operator + (const vector3d&v1, const vector3d &v2);
vector3d operator - (const point&p1, const point &p2);
vector3d operator * (float c, const vector3d &v);
vector3d operator - (const vector3d&v1, const vector3d &v2);
float operator * (const vector3d&v1, const vector3d &v2 );
vector3d operator ^ (const vector3d& v1, const vector3d& v2);
color operator * (const color&c1, const color &c2 );
color operator + (const color&c1, const color &c2 );
color operator * (float coef, const color &c );
#endif