The 2 * h is left from before refactoring by Edwin when an array was indexed where x and y coordinates of points were stored as two consecutive Doubles in an array. Then 2 * h gave the x-coordinate and 2 * h + 1 gave the y-coordinate. Now, an array storing Vector2s is used, so to retrieve the point one should index simply by h.
Issue
Index out of bounds exception when calling
hull()
Explanation and fix
The
2 * h
is left from before refactoring by Edwin when an array was indexed where x and y coordinates of points were stored as two consecutiveDouble
s in an array. Then2 * h
gave the x-coordinate and2 * h + 1
gave the y-coordinate. Now, an array storingVector2
s is used, so to retrieve the point one should index simply byh
.