public static RtMatrix ToMatrix(this Table table) { var matrix = new RtMatrix(); var header = table.Header.ToList(); matrix.M11 = Convert.ToSingle(header[0]); matrix.M12 = Convert.ToSingle(header[1]); matrix.M13 = Convert.ToSingle(header[2]); matrix.M14 = Convert.ToSingle(header[3]); matrix.M21 = Convert.ToSingle(table.Rows[0][0]); matrix.M22 = Convert.ToSingle(table.Rows[0][1]); matrix.M23 = Convert.ToSingle(table.Rows[0][2]); matrix.M24 = Convert.ToSingle(table.Rows[0][3]); matrix.M31 = Convert.ToSingle(table.Rows[1][0]); matrix.M32 = Convert.ToSingle(table.Rows[1][1]); matrix.M33 = Convert.ToSingle(table.Rows[1][2]); matrix.M34 = Convert.ToSingle(table.Rows[1][3]); matrix.M41 = Convert.ToSingle(table.Rows[2][0]); matrix.M42 = Convert.ToSingle(table.Rows[2][1]); matrix.M43 = Convert.ToSingle(table.Rows[2][2]); matrix.M44 = Convert.ToSingle(table.Rows[2][3]); return(matrix); }
public void Then_Transpose_A_Should_Be_The_Following_Matrix(Table table) { var expectedMatrix = table.ToMatrix(); var actual = RtMatrix.Transpose(_matrixContext.MatrixA); Assert.Equal(expectedMatrix, actual); }