outOfBound function
Implementation
bool outOfBound(double nextX, double nextY, double maxX, double maxY,
{double overflow = 5}) {
if (nextX > maxX + overflow ||
nextX < 0 - overflow ||
nextY > maxY + overflow ||
nextY < 0 - overflow)
return true;
else
return false;
}