static void Main(string[] args) { Vector vector1 = new Vector(5,5); //Создаем экземлпяр класса vector1 Vector vector2 = new Vector(5,4); //Создаем экземпляр класса vector2 Vector summ = vector1.Sum(vector2); //Создаем переменную "summ" и даем ей значение vecotr1.Sum(vector2) Console.WriteLine("Your sum is: " + summ.A + " " + summ.B); Console.ReadKey(); Vector minus = vector1.Minus(vector2); Console.WriteLine("Your minus is: " + minus.A + " " + minus.B ); Console.ReadKey(); Vector multiplyVect = vector1.Mult(vector2,2); Console.WriteLine("Your multiply Vectors on k is: " + multiplyVect.A + " " + multiplyVect.B ); Console.ReadKey(); double multSkal = vector1.MultSkalyar(vector2); Console.WriteLine("Your mult skalyar is: " + multSkal); Console.ReadKey(); }
//Summ vectors; public Vector Sum(Vector vector) { return new Vector(A + vector.A, B + vector.B); }
//Multiply vectors; public Vector Mult(Vector vector, double k) { return new Vector(vector.A * k, vector.B * k); }
//Multiply Skalyar vectors public double MultSkalyar(Vector vector) { return (A * B + vector.A * vector.B); }
//Minus vectors; public Vector Minus(Vector vector) { return new Vector(A - vector.A, B - vector.B); }