getCenterY method

double getCenterY()

Returns the vertical center of this rectangle.

Implementation

double getCenterY() {
  return (top + bottom) / 2;
}