Ratio package:numhask-space

convert a Rect to a ratio
>>> :set -XNegativeLiterals

>>> ratio (Rect (-1) 1 (-0.5) 0.5)
2.0