Example #1
0
        public void Test_ColumnVector_Operator()
        {
            ColumnVector l = new ColumnVector(1, 1, 1);
            ColumnVector r = new ColumnVector(1, 1, 1);

            ColumnVector add = l + r;

            Assert.True(ColumnVector.Equals(add, new ColumnVector(2, 2, 2), Ep), add.ToString());

            ColumnVector sub = l - r;

            Assert.True(ColumnVector.Equals(sub, new ColumnVector(0, 0, 0), Ep));

            ColumnVector mul = l * 2;

            Assert.True(ColumnVector.Equals(mul, new ColumnVector(2, 2, 2), Ep));

            ColumnVector mur = 2 * r;

            Assert.True(ColumnVector.Equals(mur, new ColumnVector(2, 2, 2), Ep));

            ColumnVector div = l / 2;

            Assert.True(ColumnVector.Equals(div, new ColumnVector(0.5, 0.5, 0.5), Ep));
        }