#include <stdio.h>
#include <math.h>
#include "Point2D.h"

Point2D::Point2D(double x, double y) {
  this->x=x;
  this->y=y;
};
Point2D::Point2D() {
  x=0.;
  y=0.;
};
Point2D::Point2D (const Point2D& pt) {
  this->x=pt.x;
  this->y=pt.y;
};
 Point2D operator+(const Point2D &p1, const Point2D &p2) {
    static Point2D p3;
    p3.x = p1.x + p2.x;
    p3.y = p1.y + p2.y;
    return p3;
  };
 Point2D operator-(const Point2D &p1, const Point2D &p2){
  static Point2D p3;
  p3.x = p1.x - p2.x;
  p3.y = p1.y - p2.y;
  return p3;
};
 Point2D operator*(const double factor, const Point2D &p1){
  static Point2D p3;
  p3.x = p1.x*factor;
  p3.y = p1.y*factor;
  return p3;
};
inline Point2D Point2D::operator*(const double factor){
  static Point2D p3;
  p3.x = x*factor;
  p3.y = y*factor;
  return p3;
};
//Point2D& 
 void Point2D::operator=(const Point2D &p1) {
  x = p1.x;
  y = p1.y;
  //return *this;
};

 double operator*(const Point2D &p1, const Point2D &p2) {
  return p1.x*p2.x+p1.y*p2.y;
};


