-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPunto3D.cpp
62 lines (49 loc) · 1.09 KB
/
Punto3D.cpp
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
// Punto3D.cpp: implementation of the Punto3D class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Punto3D.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Punto3D::Punto3D(double x1, double y1, double z1) : Punto2D(x1, y1) {
this->z = z1;
this->l = 0;
}
Punto3D::Punto3D(Punto3D * p) {
this->x = p->x;
this->y = p->y;
this->z = p->z;
this->l = 0;
}
Punto3D::~Punto3D() { }
Punto3D::Punto3D() { }
int Punto3D::modZ(double z1) {
if (z == z1) return -1;
z = z1;
return 0;
}
int Punto3D::modL(double l1) {
if (l == l1) return -1;
l = l1;
return 0;
}
Punto3D& Punto3D::operator= (const Punto3D &p) {
x = p.x;
y = p.y;
z = p.z;
l = p.l;
return (* this);
}
Punto3D& Punto3D::operator+ (const Punto3D &p) {
x += p.x;
y += p.y;
z += p.z;
return (* this);
}
Punto3D& Punto3D::operator- (const Punto3D &p) {
x -= p.x;
y -= p.y;
z -= p.z;
return (* this);
}