public static double distance(Vector2 a,Vector2 b){
  Vector2 tempVector=Vector2.pow(Vector2.subtract(a,b),2);
  return Math.sqrt(tempVector.x + tempVector.z);
}

public static double distance ( Vector2 a , Vector2 b ) { Vector2 tempVector = Vector2 . pow ( Vector2 . subtract ( a , b ) , 2 ) ; return Math . sqrt ( tempVector . x + tempVector . z ) ; }
gets the distance between two vector2 .
