getDiameter method

double getDiameter()

Gets the length of the diameter (diagonal) of the envelope.

@return the diameter length

Implementation

double getDiameter() {
  if (isNull()) {
    return 0;
  }
  double w = getWidth();
  double h = getHeight();
  return math.sqrt(w * w + h * h);
}