
#include "my_point.h"


using namespace std;

Point::Point(){
	x=0;
	y=0;
}

Point::~Point(){}

Point::Point(double x, double y){
	this->x=x;
	this->y=y;
}

Point::Point(const Point &pt){
	x=pt.x;
	y=pt.y;
}

void Point::operator=(const Point &pt){
	x=pt.x;
	y=pt.y;
}

bool Point::operator==(const Point &pt){
	if (x==pt.x && y==pt.y) return true;
	return false;
}

bool Point::operator!=(const Point &pt){
	return !((*this)==pt);
}


ofstream & operator<<(ofstream & out, const Point &pt){
	out<<pt.x<<" "<<pt.y<<endl;;
	return out;
}
ifstream & operator>>(ifstream & in, Point &pt){
	//char space;
	in>>pt.x>>pt.y;
	return in;
}

string Point::toString(){
	char tmp[50];
	tmp[0]='\0';
	sprintf((char *)tmp,"%f %f",x,y);
	string ret=tmp;
	return ret;
}

