/** * Returns the envelope length along the specified dimension. This length is equals to the * maximum ordinate minus the minimal ordinate. */ public double getSpan(final int dimension) { switch (dimension) { case 0: return getWidth(); case 1: return getHeight(); case 2: return getDepth(); default: throw new IndexOutOfBoundsException(String.valueOf(dimension)); } }
/** * Gets the volume of this envelope. * * @return the volume of the envelope * @return 0.0 if the envelope is null */ public double getVolume() { return getWidth() * getHeight() * getDepth(); }
/** * Gets the minimum extent of this envelope across all three dimensions. * * @return the minimum extent of this envelope */ public double minExtent() { if (isNull()) return 0.0; return Math.min(getWidth(), Math.min(getHeight(), getDepth())); }
/** * Gets the maximum extent of this envelope across both dimensions. * * @return the maximum extent of this envelope */ public double maxExtent() { if (isNull()) return 0.0; return Math.max(getWidth(), Math.max(getHeight(), getDepth())); }