export class Point {
  x = 0;
  y = 0;
  constructor(x = 0, y = 0) {
    this.x = x;
    this.y = y;
  }
  clone() {
    return new Point(this.x, this.y);
  }
  copyFrom(p: Point) {
    this.set(p.x, p.y);

    return this;
  }
  copyTo(p: Point) {
    p.set(this.x, this.y);

    return p;
  }
  equals(p: Point) {
    return p.x === this.x && p.y === this.y;
  }

  set(x = 0, y = x) {
    this.x = x;
    this.y = y;
  }
}
