A method is suggested to determine of minimum distance between orbits of two celestial bodies. The method is based on finding of the singular points of one variable function. The orbits of celestial bodies can be elliptic, parabolic or hyperbolic. The orbits of celestial bodies can also be described universal variable. On the basis of the given method the program is developed, using which the accounts of minimal distance between orbits of comets and orbits of planets are executed. The given method can also be used for finding of the minimal distances both between orbits of asteroids and orbits of planets, and between asteroids orbits