Continue cleaning.
This commit is contained in:
parent
cd688f608f
commit
cb4212d972
67 changed files with 367 additions and 282 deletions
|
@ -1,92 +0,0 @@
|
|||
#include "Point.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
Point::Point(double x, double y, double z)
|
||||
: mX(x),
|
||||
mY(y),
|
||||
mZ(z)
|
||||
{
|
||||
}
|
||||
|
||||
Point::Point(const DiscretePoint& point)
|
||||
: mX(static_cast<double>(point.getX())),
|
||||
mY(static_cast<double>(point.getY())),
|
||||
mZ(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Point::Point(const Point& reference, double offSetX, double offSetY, double offSetZ)
|
||||
: mX(reference.getX() + offSetX),
|
||||
mY(reference.getY() + offSetY),
|
||||
mZ(reference.getZ() + offSetZ)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Point::~Point()
|
||||
{
|
||||
};
|
||||
|
||||
std::shared_ptr<Point> Point::Create(double x, double y, double z)
|
||||
{
|
||||
return std::make_shared<Point>(x, y, z);
|
||||
}
|
||||
|
||||
double Point::getX() const
|
||||
{
|
||||
return mX;
|
||||
}
|
||||
|
||||
double Point::getY() const
|
||||
{
|
||||
return mY;
|
||||
}
|
||||
|
||||
double Point::getZ() const
|
||||
{
|
||||
return mZ;
|
||||
}
|
||||
|
||||
double Point::getDistance(const Point& point) const
|
||||
{
|
||||
const auto deltaX = getDeltaX(point);
|
||||
const auto deltaY = getDeltaY(point);
|
||||
const auto deltaZ = getDeltaZ(point);
|
||||
return std::sqrt(deltaX* deltaX + deltaY* deltaY + deltaZ* deltaZ);
|
||||
}
|
||||
|
||||
Vector Point::getDelta(const Point& point) const
|
||||
{
|
||||
return Vector(point.mX - mX, point.mY - mY, point.mZ - mZ);
|
||||
}
|
||||
|
||||
double Point::getDeltaX(const Point& point) const
|
||||
{
|
||||
return point.getX() - mX;
|
||||
}
|
||||
|
||||
double Point::getDeltaY(const Point& point) const
|
||||
{
|
||||
return point.getY() - mY;
|
||||
}
|
||||
|
||||
double Point::getDeltaZ(const Point& point) const
|
||||
{
|
||||
return point.getZ() - mZ;
|
||||
}
|
||||
|
||||
void Point::scale(double x, double y, double z)
|
||||
{
|
||||
mX = x * mX;
|
||||
mY = y * mY;
|
||||
mZ = z * mZ;
|
||||
}
|
||||
|
||||
void Point::translate(double x, double y, double z)
|
||||
{
|
||||
mX += x;
|
||||
mY += y;
|
||||
mZ += z;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue