question: private double calcDistanceIndicator ( final double x , final double y ) { double distanceX ; double distanceY ; if ( this . minX <= x && x <= this . maxX ) { distanceX = 0 ; } else { distanceX = Math . min ( Math . abs ( this . minX - x ) , Math . abs ( this . maxX - x ) ) ; } if ( this . minY <= y && y <= this . maxY ) { distanceY = 0 ; } else { distanceY = Math . min ( Math . abs ( this . minY - y ) , Math . abs ( this . maxY - y ) ) ; } return distanceX * distanceX + distanceY * distanceY ; }
target:  Calculates the distance of a given point to the border of the rectangle. If the point lies within the rectangle, the distance is zero.