## 3 Method
\[\overset{\sim(i)}{f}\left(\theta_{j},\varphi_{j}\right)=\sum_{l=0}^{10}\sum_{m= -l}^{l}f^{(i)}_{lm}Y_{lm}(\theta_{j},\varphi_{j}).\] (1)
* Next, on the unit sphere, let us add all the functions \(\overset{\sim(i)}{f}\left(\theta_{j},\varphi_{j}\right)\) over the entire set of concentric spheres as follows: \[\overset{\sim}{f}\left(\theta_{j},\varphi_{j}\right)=\sum_{i=1}^{n}\overset{ \sim(i)}{f}\left(\theta_{j},\varphi_{j}\right)\] (2) and define a surface \(\left(\theta_{j},\varphi_{j},\overset{\sim}{f}\left(\theta_{j},\varphi_{j} \right)\right)\). The surface points are connected the same way as the corresponding points of the icosphere. * Find the extrema points and saddle points of the surface \(\overset{\sim}{f}\) of the previous item. * Build the convex hull of the points found in the previous item. * Order these points by not increasing their radius vector lengths. Denote this sequence as \(F\). We repeat the same preprocessing for object \(O_{2}\) and denote the corresponding calculated function with replacement \(f\) to \(g\), obtaining, for example, \(\widetilde{\delta}\left(\theta_{j},\varphi_{j}\right)\), etc. **Steps of the algorithm. ** Let us find a transformation matrix that maps \(O_{1}\) to \(O_{2}\), if it exists. * Let us compare the scaling coefficient \(f_{\text{scale}}\) and \(g_{\text{scale}}\). If the objects are not equal (up to some tolerance), they are different. If we want to check the similarity of two objects while ignoring the scale, go to the next step. * For each sphere \(i=1,\ldots,n\), calculate and compare energy for each degree \(l\) for both objects. If \[\left|\sum_{m=-l}^{l}\left|f_{lm}^{(i)}\right|^{2}-\sum_{m=-l}^{l}\left|g_{lm} ^{(i)}\right|^{2}\right|>\text{Tolerance}\] for at least one degree \(l\), then the objects are different; otherwise, go to the next step. * Let us choose vector \(f_{1}\). This is the longest vector from sequence \(F\) that has not yet been used by the algorithm. If there is no such vector, go to step A8. * Look for subsequent vectors \(f_{2}\) from \(F\), which forms an angle of at least 10 degrees with \(f_{1}\). For each such vector, pair \(f_{1}\) and \(f_{2}\) and go to the next step; otherwise, go to step A3. * Find the furthest point \(f_{3}\) of the convex hull from the plane \(\alpha\), which contains the origin and vectors \(f_{1}\) and \(f_{2}\). Find, if any, the corresponding points, \(g_{1},g_{2}\), and \(g_{3}\), in sequence \(G\). These points in \(G\) should have the same length of vectors and angles among vectors (up to some tolerance) as the vectors in \(F\). The scalar triple product of \((f_{1},f_{2},f_{3})\) and \((g_{1},g_{2},g_{3})\) should have the same sign. If there are no such vectors, go to step A3 and look for the next vector \(f_{1}\). * Calculate the rotation matrix using the Kabsch algorithm [25; 26] to map the triplet of non-coplanar vectors \((f_{1},f_{2},f_{3})\) to \((g_{1},g_{2},g_{3})\). If this (or similar, up to some tolerance) rotation matrix was calculated and analyzed before, go to step A3, and look for the next vector \(f_{1}\). * Using the rotation matrix found, rotate \(O_{2}\) to \(\overline{O}_{2}\), and calculate the vector of spherical harmonic coefficients \(\widetilde{g}_{lm}^{(i)}\) for \(\overline{O}_{2}\). In the ideal case, objects \(O_{1}\) and \(\overline{O}_{2}\) should coincide. For each sphere \(i\), we calculate the cosine similarity \(\text{CS}^{(i)}\) (i.e., find the angle between two vectors), \(\overline{g}_{lm}^{(i)}\), and \(f_{lm}^{(i)}\). To evaluate the quality of the mapping, we introduce two metrics (see Section 3.3) as follows: \[M_{1}=\min_{i=1,\ldots,n}\text{CS}^{(i)}\,\qquad M_{2}=\sum_{i=1}^{n}\Bigl{(}1- \text{CS}^{(i)}\Bigr{)}.\]  
The rotation matrix found is considered an acceptable solution if \(M_{1}\) is more than some tolerance (we set it as \(\cos(10^{0})=0.9848\), with the perfect match being 1.0). This means that the cosine similarity of each sphere is greater than this value.