public void TestMultiplyVectorByMatrix_01() { Vector vector = new Vector(1, 4, 5); Matrix matrix = new Matrix(4, 4, new double[4, 4] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 1, 2, 3 }, { 4, 5, 6, 7 } }); Vector expected = new Vector(70, 36, 47, 58); Vector result = Operataion.MultiplyVectorByMatrix(vector, matrix); Assert.IsTrue(expected == result); }
public void TestMultiplyMatrixByVector_02() { Vector vector = new Vector(1, 4, 5); Matrix matrix = new Matrix(4, 4, new double[4, 4] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 1, 2, 3 }, { 4, 5, 6, 7 } }); Vector expected = new Vector(28, 72, 26, 61); Vector result = Operataion.MultiplyMatrixByVector(matrix, vector); Assert.IsTrue(expected == result); }
public Vector TransformToViewPoint(Vector vector) { var result = Operataion.MultiplyMatrixByVector(_transformMatrix, vector); return(result); }