This paper considers the problem of forming a preset surface of a segmented mirror of a telescope. An iteration algorithm based on analysis of the interference pattern of the radiation reflected from the mirror is used for phasing the mirror segments. At every iteration, the current interferogram is compared with the reference one obtained for the surface of a preset shape. The value of the control goal function, whose minimum is determined in the algorithm, decreases with the decreasing discrepancy between the interferograms. This technique provides for formation of a plane-reflecting surface of the mirror, if the relative displacement of segments does not exceed the half wavelength. It is shown that to extend the range of acceptable displacements, it is necessary to introduce additional sources of radiation of specially chosen wavelengths. In such a case, the dynamic range of the algorithm can be extended up to 30 mkm.