Пример #1
0
            public void source_vector_is_unchanged()
            {
                var actual = new VectorD(3);

                actual.Set(0, 1);
                actual.Set(1, 2);
                actual.Set(2, -4);
                var expected = new VectorD(actual);

                var result = actual.GetScaled(2);

                Assert.Equal(expected, actual);
            }
Пример #2
0
            public void can_get_scaled_vector()
            {
                var source = new VectorD(3);

                source.Set(0, 1);
                source.Set(1, 2);
                source.Set(2, -4);
                var expected = new VectorD(3);

                expected.Set(0, 3);
                expected.Set(1, 6);
                expected.Set(2, -12);

                var actual = source.GetScaled(3);

                Assert.Equal(expected, actual);
            }