Formulation of the problem
Consider the problem of finding the angle of rotation and displacement of a point cloud. A point cloud means a set of points on a plane that preserves the relative position of each other during their spatial movement.
Those. There are two sets of points: the initial cloud and the cloud transformed arbitrarily in space (see Fig. 1). Any transformation of a point cloud in space can be interpreted as rotation and displacement. Thus, it is necessary to determine at what angle you want to rotate the original point cloud and how far it should be moved from the original point cloud in order to get the same point cloud converted in an arbitrary way.

Fig. 1 Example of a point cloud to which a rotation of 15 degrees is applied, and an offset along the X axis: 10, along the Y axis: 30
Algorithm
1. Determining the offset of the point cloud
To determine the displacement of a point cloud, it is necessary to determine the centers of mass of the original point cloud and the transformed point cloud. The displacement of the center of mass of the transformed point cloud relative to the original point cloud is the required displacement. When determining the center of mass, all points have the same weight.
To find the center of mass, it is necessary to sum the coordinates of all points, and divide by the total number of points.
Thus, for the example considered above: the center of mass of the original point cloud (0; 0) and the center of mass of the transformed point cloud (10; 30). Therefore, the offset of the converted point cloud relative to the original point cloud along the X: 10 axis, and along the Y: 30 axis.
2. Determining the angle of rotation of the point cloud
(. 2). , . 90 , 4 .

. 2
, . , , .
I=(IxxIxyIyxIyy), :
Ixx=โn=1N[(xโxc)2]Ixy=โn=1N[(xโxc)(yโyc)]Iyx=โn=1N[(xโxc)(yโyc)]Iyy=โn=1N[(yโyc)2].
:
โ : (33334 0; 0 11667), : (1; 0) (0; 1), 0 90 .
โ : (31882.5 -54167.5; -54167.5 13118.4), (0.9659 -0.2588) (0.2588 0.9659), -15 75 .
, 15, 105, 195 285 . , 15 .
: . Matlab, .

. 3

. 4

. 5
Using the method described above, you can determine the angle of rotation and the offset of the original cloud of points, relative to another. Which is obtained using any spatial movement of the original point cloud. Additionally, in the presence of a small error (normal distribution), this method also works stably (see Fig. 3 and Fig. 5).
This method can also be used in digital image processing when it is necessary to determine the spatial location of any object.
The main idea of โโthis article is for the reader to immediately apply the described method if he ever encounters a similar task, and does not spend time on it.