clampDouble method
Clamps this vector so that it is within or equals to the bounds defined by
(minX, maxX) and (minY, maxY).
Implementation
void clampDouble(double minX, double maxX, double minY, double maxY) {
x = x.clamp(minX, maxX);
y = y.clamp(minY, maxY);
}