static _clampRectangle(input, clamp, result) {
    if (!defined(result)) {
      result = new Rectangle();
    }
    if (input.south >= clamp.north) {
      result.north = result.south = clamp.north;
    } else if (input.north <= clamp.south) {
      result.north = result.south = clamp.south;
    } else {
      result.south = Math.max(input.south, clamp.south);
      result.north = Math.min(input.north, clamp.north);
    }

    if (input.west >= clamp.east) {
      result.west = result.east = clamp.east;
    } else if (input.east <= clamp.west) {
      result.west = result.east = clamp.west;
    } else {
      result.west = Math.max(input.west, clamp.west);
      result.east = Math.min(input.east, clamp.east);
    }
    return result;
  }
Clamp the given input rectangle to the given clamp rectangle.

If the input rectangle is completely above/below or left/right
of the clamp rectangle, then the north/south or east/east
if the clamp rectangle will be used in the result.

@param {Rectangle} input The input rectangle
@param {Rectangle} clamp The clamping rectangle
@param {Rectangle} [result] The result
@returns {Rectangle} The result