Пример #1
0
        protected static BaseVector Subtraction(List <BaseVector> vectors, int countCoordinate)
        {
            BaseVector resultVector = new BaseVector(countCoordinate);

            for (var i = 0; i < countCoordinate; ++i)
            {
                resultVector.Coordinates[i] = vectors[0].Coordinates[i] - vectors[1].Coordinates[i];
            }
            return(resultVector);
        }
Пример #2
0
        protected static BaseVector Multiply(BaseVector vectors, int values)
        {
            BaseVector resultVector = new BaseVector(vectors.Coordinates.Length);

            for (var i = 0; i < vectors.Coordinates.Length; ++i)
            {
                resultVector.Coordinates[i] = values * vectors.Coordinates[i];
            }
            return(resultVector);
        }
Пример #3
0
        protected static BaseVector Addition(List <BaseVector> vectors, int countCoordinate)
        {
            BaseVector resultVector = new BaseVector(countCoordinate);

            for (var i = 0; i < countCoordinate; ++i)
            {
                foreach (var t in vectors)
                {
                    resultVector.Coordinates[i] += t.Coordinates[i];
                }
            }
            return(resultVector);
        }