Source: https://juliette.hernando.free.fr/scratch/friserectangles2.pdf