Creating a rectangle by two points - the ends of the rectangle diagonal. Sides - vertical and horizontal segments.