class StretchingComplexity implements ITimeSeriesComplexity {

	@Override
	public double complexity(final double[] t) {
		int n = t.length;
		double sum = .0;
		for (int i = 0; i < n - 1; i++) {
			sum += Math.sqrt(1 + Math.pow(t[i + 1] - t[i], 2));
		}
		return sum;
	}

}