static double g22_squareness(Rect r) { ret doubleRatio(min(r.w, r.h), max(r.w, r.h)); } // Original approach - turns out this is just the same as the version // above /*static double g22_squareness_b(Rect r) { ret distanceToProbability(doubleRatio(max(r.w, r.h), min(r.w, r.h))-1); }*/