#include "Point.h"

#include <cmath>

Point::Point() : x(0.0), y(0.0), z(0.0) {}

Point::Point(double x, double y, double z) : x(x), y(y), z(z) {}


double Point::getX() const {
	return x;
}
double Point::getY() const{
	return y;
}
double Point::getZ() const {
	return z;
}


void Point::setX(double x){
	this->x=x;
}
void Point::setY(double y){
	this->y=y;
}
void Point::setZ(double z){
	this->z=z;
}


double Point::ZeroDist() const{
	return std::sqrt(x*x + y*y + z*z);
}

double Point::EuclDist(const Point& other) const {
	double dx = x - other.x;
	double dy = y - other.y;
	double dz = z - other.z;

	return std::sqrt(dx*dx + dy*dy + dz*dz);
}

double Point::ZeroManhattan() const{
	return std::fabs(x) + std::fabs(y) +std::fabs(z);
}

double Point::ManhattanDist(const Point& other) const {
	return std::fabs(x-other.x) +
		std::fabs(y-other.y) +
		std::fabs(z-other.z);
}
