Can someone help me through? Java/Rectangles : i am currently working with a project involving rectangles and i want to create a public method which takes as a definition another rectangle and returns the smallest possible distance between them.(it can be calculated through the smaller possible distances of each projection on each axis respectively).

I also need another method that returns the biggest possible distance between 2 rectangles. I am quite confused by the complexity needed and not sure how to construct it and would like some help.

http://imgur.com/IcHTGII --> this is an example .

Here are the basic constructors used to develop it.

        class Rectangle 
        { 
         private int dimensionality; 
         private double[] lowerBound; 
         private double[] upperBound; 
        
         public Rectangle(int dimensionality){ 
         this.dimensionality = dimensionality; 
         lowerBound = new double[dimensionality]; 
         upperBound = new double[dimensionality]; 
         } 
        }