public Vector2(double direction){
  this.x=Math.cos(direction);
  this.y=Math.sin(direction);
}

public Vector2 ( double direction ) { this . x = Math . cos ( direction ) ; this . y = Math . sin ( direction ) ; }
creates a unit length vector in the given direction .
