-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeometry.cpp
More file actions
102 lines (77 loc) · 1.26 KB
/
Copy pathgeometry.cpp
File metadata and controls
102 lines (77 loc) · 1.26 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "stdlib.h"
#include "geometry.h"
float Point::getX(){
return x;
}
float Point::getY(){
return y;
}
float Point::getZ(){
return z;
}
void Point::setX(float x){
this->x = x;
}
void Point::setY(float y){
this->y = y;
}
void Point::setZ(float z){
this->z = z;
}
float* Point::getArrayCoors(){
float* ar = (float*)malloc (3 * sizeof(float));
ar[0] = x;
ar[1] = y;
ar[2] = z;
return ar;
}
Point Line::getFirstPoint(){
return p1;
}
Point Line::getSecondPoint(){
return p2;
}
Point* Line::getArrayPoints(){
Point* ar = (Point*)malloc (2 * sizeof(Point));
ar[0] = p1;
ar[1] = p2;
return ar;
}
void Line::setFirstPoint(Point p1){
this->p1 = p1;
}
void Line::setSecondPoint(Point p2){
this->p2 = p2;
}
float Plane::getA(){
return a;
}
float Plane::getB(){
return b;
}
float Plane::getC(){
return c;
}
float Plane::getD(){
return d;
}
float* Plane::getArrayABCD(){
float* ar = (float*)malloc (4 * sizeof(float));
ar[0] = a;
ar[1] = b;
ar[2] = c;
ar[3] = d;
return ar;
}
void Plane::setA(float a){
this->a = a;
}
void Plane::setB(float b){
this->b = b;
}
void Plane::setC(float c){
this->c = c;
}
void Plane::setD(float d){
this->d = d;
}