public final double distance ( final double [ ] value1 , final double [ ] value2 ) { double agg = 0 ; for ( int i = 0 ; i < value1 . length ; i ++ ) { agg += ( value1 [ i ] - value2 [ i ] ) * ( value1 [ i ] - value2 [ i ] ) ; } return Math . sqrt ( agg ) ; }
Compute traditional Euclidean distance .