-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint2D.cpp
More file actions
53 lines (32 loc) · 1.03 KB
/
Copy pathPoint2D.cpp
File metadata and controls
53 lines (32 loc) · 1.03 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
// Copyright (C) Kevin Suffern 2000-2007.
// This C++ code is for non-commercial purposes only.
// This C++ code is licensed under the GNU General Public License Version 2.
// See the file COPYING.txt for the full license.
#include "Point2D.h"
// ------------------------------------------------ default constructor
Point2D::Point2D(void)
: x(0.0), y(0.0)
{}
// ------------------------------------------------ constructor
Point2D::Point2D(const float arg)
: x(arg), y(arg)
{}
// ------------------------------------------------ constructor
Point2D::Point2D(const float x1, const float y1)
: x(x1), y(y1)
{}
// ------------------------------------------------ copy constructor
Point2D::Point2D(const Point2D& p)
: x(p.x), y(p.y)
{}
// ------------------------------------------------ destructor
Point2D::~Point2D(void) {}
// ------------------------------------------------ assignment operator
Point2D&
Point2D::operator= (const Point2D& rhs) {
if (this == &rhs)
return (*this);
x = rhs.x;
y = rhs.y;
return (*this);
}