and YU: the rotation matrixLocal variables:k: the number of random samplesQx and Qy: the subsets of X and YRx and Ry: the sets of the remaining points, i.e. Rx ??? X - Qx and Rx Y - Qyc??x and c??y: the temporary centersU??: the temporary rotation matrixrmin: the minimal residualrmax: the maximal residualbegin1: Qx ??? ???; Qy ??? ???;2: LMS(X, Y, k, Qx, Qy);3: I ??? 0;4: Rx ??? X - Qx; Ry ??? Y