#include "dbpoint.h"

/*****************************************************
 ** Definitions for functions from dbpoint.h.
 *****************************************************/
Point operator-(Point p, Point q){
  Point m;
  m.x = p.x - q.x; 
  m.y = p.y - q.y;
  return m;
}

Point operator+(Point p, Point q){
  Point m;
  m.x = p.x + q.x; 
  m.y = p.y + q.y;
  return m;
}

Point operator*(Point p, double k){
  Point m;
  m.x = p.x * k;
  m.y = p.y * k;
  return m;
}

Point operator/(Point p, double k){
  return p*(1/k);
}

ostream& operator<<(ostream &OUT, Point p){
  return OUT << '(' << p.x << ',' << p.y << ')';
}

istream& operator>>(istream &IN, Point &p){
  char c;
  return IN >> c >> p.x >> c >> p.y >> c;
}