signedArea function
Implementation
double signedArea(List<double> data, int start, int end, int dim) {
double sum = 0.0;
for (int i = start, j = end - dim; i < end; i += dim) {
sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
j = i;
}
return sum;
}