private static double distance ( double [ ] subseries , double [ ] series , int from , int to , double nThreshold ) throws Exception { double [ ] subsequence = tp . znorm ( tp . subseriesByCopy ( series , from , to ) , nThreshold ) ; Double sum = 0D ; for ( int i = 0 ; i < subseries . length ; i ++ ) { double tmp = subseries [ i ] - subsequence [ i ] ; sum = sum + tmp * tmp ; } return Math . sqrt ( sum ) ; }
Calculates the Euclidean distance between two points . Don t use this unless you need that .