private static double distance ( double [ ] pointA , double [ ] pointB ) { double distance = 0.0 ; for ( int i = 0 ; i < pointA . length ; i ++ ) { double d = pointA [ i ] - pointB [ i ] ; distance += d * d ; } return Math . sqrt ( distance ) ; }
Distance between two vectors .