public Vector2 rotate(double theta){
  double cos=Math.cos(theta);
  double sin=Math.sin(theta);
  double x=this.x;
  double y=this.y;
  this.x=x * cos - y * sin;
  this.y=x * sin + y * cos;
  return this;
}

public Vector2 rotate ( double theta ) { double cos = Math . cos ( theta ) ; double sin = Math . sin ( theta ) ; double x = this . x ; double y = this . y ; this . x = x * cos - y * sin ; this . y = x * sin + y * cos ; return this ; }
rotates about the origin .
