/** * Computes a hash code for a superellipsoid. The hash code value is based * on the superellipsoid's position, semi-axis lengths, exponent and * boundary type. * * @param ellipsoid * The superellipsoid for which to compute the hash code. * @return Hash code of the superellipsoid. */ static int hashCode( final SuperEllipsoid ellipsoid ) { int result = 22; for ( int i = 0; i < ellipsoid.numDimensions(); i++ ) result += 13 * ellipsoid.center().getDoublePosition( i ) + 13 * ellipsoid.semiAxisLength( i ); result += ellipsoid.exponent(); if ( ellipsoid.boundaryType() == BoundaryType.CLOSED ) result += 5; else if ( ellipsoid.boundaryType() == BoundaryType.OPEN ) result += 8; return result; }