public class Vector2D {
   private int x, y;  // we will use cartesian coordinates
   public Vector2D () {
      x = y = 0;
   }
   public Vector2D (int x, int y) {
      this.x = x;
      this.y = y;
   }
   public int getX(){
      return x;
   }
   public int getY(){
      return y;
   }
   public void moveTo(int x, int y){ // to set a new position
      this.x=x;
      this.y=y;
   }
   public Vector2D plus(Vector2D v) {
      if (v==null) return new Vector2D(x,y);
      else return new Vector2D(x+v.x, y+v.y);
   }
   public Vector2D times(int scalar) {
      return new Vector2D(x*scalar, y*scalar);
   }
   public Vector2D minus(Vector2D v) {
      if (v==null) return new Vector2D(x,y);
      else return new Vector2D(x-v.x, y-v.y);
   }
   public int dot(Vector2D v) {
      return x*v.x + y*v.y;
   }
   public static String getDescription() {
      return "(x,y)";
   }
   public String toString(){
      return  x + ", " + y;
   }
}
  