you axisaligne rectangle room width W height h low leave corner point 0 0 upper right corner W HThere rectangular table standing room the side table parallel wall lower left corner x_1 y_1 upper right corner x_2 y_2You want place rectangular table room width w height h width table parallel width roomthe problem space place second table intersect problem table touch thoughyou can not rotate table table inside room example table what minimum distance table free space second