Пример #1
0
    public double [,] generate_rotation_matrix(Vector3 [] new_positions)
    {
        //3x3 matrix of zeros used for summation
        apq = new double [, ] {
            { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }
        };
        for (int i = 0; i < original_positions.Length; i++)
        {
            MatrixFunctions.matrix_add_3x3(ref apq, MatrixFunctions.vector3_covariance(new_positions[i], original_positions[i]));
            //CHECKED: new positions are different from old ones, seem consitent
        }
        //CHECKED THROUGH THIS POINT
        s = MatrixFunctions.matrixMultiply3x3(MatrixFunctions.transpose3x3(apq), apq);

        MatrixFunctions.matrixInverseSquareRoot(ref s);

        double [,] r = MatrixFunctions.matrixMultiply3x3(apq, s);

        return(r);
    }