我正在尝试创建一种方法来检查某些 Y 坐标的第一个差异,如果第一个差异相同,它将采用这些差异并检查第二个差异,并且我想继续检查直到我的变量相等。我的问题是检查我的差异数组中的相等性
public static double[] Difference(double ardY[]) {
double ardDifference[] = new double[5];
for (int j = 0; j < 5; j++) {
ardDifference[j] = ardY[j + 1] - ardY[j];
while (ardDifference[j] != ardDifference[j]) {
for (int i = 0; i < 4; i++) {
ardDifference[i] = ardY[i + 1] - ardY[i];
if (ardDifference[j] == ardDifference[i]) {
return ardDifference;
break;
}
}
}
}
return ardDifference;
}