I want to sort some rectangles from biggest to smallest, but with a tunable advantage favoring squarer rectangles. I'm sure this is super easy but I'm not getting it. I think it's related to topics of dimensionality reduction, distortion, transformations.
The areas of the rectangles from origin to each of p might be equal, but squareness of the rectangle should be given a higher score by some tunable factor. Among rectangles of the same aspect ratio, bigger wins. But a smaller rectangle with a squarer aspect ratio can get a higher score than a bigger area that is less square.
https://www.desmos.com/calculator/emetuclvju
When the squareness weight indicates that squareness is irrelevant, we're just sorting by basic area (and ties are to be dealt with some other way). Everything along the red line here scores the same. Thinking geometrically, when squareness is given a positive weighting, then the curves would distort to be, what, sharper? So that the curve shows that points away from the purple line would be considered tie-scores with smaller squares?
So there's AREA, SQUARENESS, and a SQUARENESS_WEIGHT (0.0 ..1.0 ?) as inputs to a formula that should spit out a score. I'm sure I'm over thinking this. And I'm SURE this is a common need for sorting data as an alternative to sorting by height, width or area alone.
I'm also getting hung up on whether the resulting score should relate to anything geometrically/intuitively or whether the scale of the domain is arbitrary. Like, should a square get the same score as the area, with skinnier rectangles downgraded? Or should 1x rectangles keep the area-score but squares get a boosted score?