rectpack2D
rectpack2D copied to clipboard
remove the pathological multiplier for being useless
the pathological multiplier is defined as
max(w, h) / min(w, h) × w × h
substituting for all possible orderings of w and h:
-
w < h:h / w × w × h=h × h -
w > h:w / h × w × h=w × w -
w = h:n / n × n × n=n × n(wheren=w=h)
thus this is equvialent to max(w, h)²
because the comparator is only used for sorting the rectangles, and negative-sized rectangles are generally not used, max(w, h) and max(w, h)² will sort the rectangles in the same order
since max(x, y) is already one of the comparators, this means that the pathological ordering is redundant