public static Side nearestSide( Rectangle source, Rectangle target ){ 
		double smx = source.getCenterX();
		double smy = source.getCenterY();
		
		int tx = target.x;
		int ty = target.y;
		int tw = target.width;
		int th = target.height;
		
		int sx = source.x;
		int sy = source.y;
		int sw = source.width;
		int sh = source.height;
		
		double distNW = dist2( smx, smy, tx, ty );
		double distNE = dist2( smx, smy, tx+tw, ty );
		double distSW = dist2( smx, smy, tx, ty+th );
		double distSE = dist2( smx, smy, tx+tw, ty+th );
		
		double min = Math.min( Math.min( distNW, distNE ), Math.min( distSW, distSE ) );
		
		if( distNW == min ){
			if( targetOverLineOnScreen( smx, smy, sx, sy, tx, ty )){
				return Side.WEST;
			}
			else{
				return Side.NORTH;
			}
		}
		else if( distNE == min ){
			if( targetOverLineOnScreen( smx, smy, sx+sw, sy, tx+tw, ty )){
				return Side.EAST;
			}
			else{
				return Side.NORTH;
			}
		}
		else if( distSW == min ){
			if( targetOverLineOnScreen( smx, smy, sx, sy+sh, tx, ty+th )){
				return Side.SOUTH;
			}
			else{
				return Side.WEST;
			}
		}
		else{
			if( targetOverLineOnScreen( smx, smy, sx+sw, sy+sh, tx+tw, ty+th )){
				return Side.SOUTH;
			}
			else{
				return Side.EAST;
			}
		}
	}