def escapes(lower, coordinate, velocity, upper):
  """
  Determines if the projected coordinate by the velocity escapes a defined lower or upper boundary.

  Returns one of the following values:
    * Negative: The projected coordinate escaped the lower boundary by the returned amount.
    * Neutral: The projected coordinate stayed within both the lower and upper boundary.
    * Positive: The projected coordinate escaped the upper boundary by the returned amount.
  """
  result = 0 # Assume the projected coordinate stays within both the lower and upper boundary.

  if coordinate + velocity < lower:
    result = lower - (coordinate - velocity)
  elif upper < coordinate + velocity:
    result = (coordinate + velocity) - upper

  return result