public double distance ( Vector2D vector2d ) { double a = vector2d . x - x ; double b = vector2d . y - y ; return Math . sqrt ( a * a + b * b ) ; }
Calculate the distance between 2 vector by using Pythagoras formula .