-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvec.java
More file actions
58 lines (43 loc) · 999 Bytes
/
vec.java
File metadata and controls
58 lines (43 loc) · 999 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class vec{
public int x = -1; //X-Coord
public int y = -1; //Y-Coord
public int z = -1; //Z-Coord
//Konstruktor
public vec(int x, int y, int z){
this.x = x;
this.y = y;
this.z = z;
}
public vec(int x, int y){
this.x = x;
this.y = y;
}
//--- GET ---//
//getX()
public int getX(){ return this.x; }
//getY()
public int getY(){ return this.y; }
//getZ()
public int getZ(){ return this.z; }
//--- SET ---//
//setX()
public void setX(int x){ this.x = x; }
//setY()
public void setY(int y){ this.y = y; }
//setZ()
public void setZ(int z){ this.z = z; }
//copy()
public vec copy(){
vec out = new vec(this.x,this.y,this.z);
return out;
}
//compare()
public boolean compare(vec v){
if(v.x==this.x && v.y==this.y && v.z==this.z){ return true; }
else{ return false; }
}
//print()
public void print(){
System.out.print(this.x + "," + this.y + "," + this.z);
}
}