| The closest distance of two objects is the distance between their centers when they areexternally tangent. The objects may be arbitrary geometric shapes or physical particles withwell defined boundaries. The closest distance is also known as the contact distance.The closest distance of hard particles is a key parameter of their interaction and plays animportant role in computer simulations of liquid crystals and colloidal systems, and it also hasa wide range of applications in particle packing system. The maximum packing density ofhard particles, an important problem of ongoing interest, depends on their closest distance.This article, based on the existing algorithms, studied the computation of the closestdistance of two ellipsoids and proposed an improved algorithm to calculate the closestdistance of two ellipsoids. Consider two tangent ellipsoids, each with a given shape andorientation, whose centers are on a line with given direction, we firstly transform the twoellipsoids into an unit sphere and another ellipsoid along its axis directions, the sphere and theellipsoid remain tangent after the transformation. Then solve the eigenvalues and eigenvectorsof the third-order real symmetric matrix to determine the axis length and direction of theellipsoid, after that construct a plane containing the line joining the centers of the twoellipsoids, and finding the equations of the ellipses formed by the intersection of this planeand the ellipsoids, then calculate the closest distance between the unit circle and the ellipse inthe two-dimensional space. Finally rotate the plane to find the maximum value by improvedgolden section search method, The maximum is the closest distance between the ellipsoids.Algorithm implemented with C/C++language, and compared with the existingalgorithms under Windows and Linux environments respectively, the results show that theimproved algorithm has been significantly improved and upgraded in terms of efficiency andspeed of execution, the program execution time reduced about26.27%. |