-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPoint.cpp
More file actions
41 lines (35 loc) · 867 Bytes
/
Point.cpp
File metadata and controls
41 lines (35 loc) · 867 Bytes
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
#include <vector>
using namespace std;
/**
** Class for Points represantation
**/
#define dimensions 2
class Point{
public:
double dim[dimensions];
Point(){
for(int i = 0; i < dimensions; i++) {
dim[i] = 0.0;
}
}
Point(vector<double> aDim){
for(int i =0;i<aDim.size();i++){
dim[i] = aDim[i];
}
}
double getCertainDim(int index){
return dim[index];
}
vector<double> getDim() {
vector<double> out(dimensions);
for(int i =0;i<out.size();i++){
dim[i] = out[i];
}
return out;
}
void setCoords(vector<double> coords){
for(int i =0;i<coords.size();i++){
dim[i] = coords[i];
}
}
};