-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoint3d.cpp
More file actions
56 lines (44 loc) · 763 Bytes
/
Copy pathpoint3d.cpp
File metadata and controls
56 lines (44 loc) · 763 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
#include "point3d.h"
Point3D::Point3D(double x, double y, double z) :
_mtrx({{x, y, z}})
{
}
double Point3D::get_x() const
{
return _mtrx[0][0];
}
double Point3D::get_y() const
{
return _mtrx[0][1];
}
double Point3D::get_z() const
{
return _mtrx[0][2];
}
void Point3D::set_x(double x)
{
_mtrx[0][0] = x;
}
void Point3D::set_y(double y)
{
_mtrx[0][1] = y;
}
void Point3D::set_z(double z)
{
_mtrx[0][2] = z;
}
Point3D &Point3D::operator=(const Point3D &other)
{
this->set_x(other.get_x());
this->set_y(other.get_y());
this->set_z(other.get_z());
return *this;
}
Point3D Point3D::inverse() const
{
return Point3D(-_mtrx[0][0], -_mtrx[0][1], -_mtrx[0][2]);
}
Matrix &Point3D::matrix()
{
return _mtrx;
}