-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPunto2D.cpp
More file actions
42 lines (33 loc) · 855 Bytes
/
Punto2D.cpp
File metadata and controls
42 lines (33 loc) · 855 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
// Punto2D.cpp: implementation of the Punto2D class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Punto2D.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Punto2D::Punto2D(double x1, double y1) {
x = x1;
y = y1;
}
Punto2D::~Punto2D() { }
Punto2D::Punto2D() { }
int Punto2D::modX(double x1) {
if (x == x1) return -1;
x = x1;
return 0;
}
int Punto2D::modY(double y1) {
if (y == y1) return -1;
y = y1;
return 0;
}
Punto2D& Punto2D::operator= (const Punto2D &p) {
x = p.x;
y = p.y;
return (* this);
}
bool Punto2D::operator==(const Punto2D &p) {
if ((int(x) == int(p.x)) && (int(y) == int(p.y))) return true;
return false;
}