Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 //Summ vectors;
 public Vector Sum(Vector vector)
 {
     return new Vector(A + vector.A, B + vector.B);
 }
Esempio n. 3
0
 //Multiply vectors;
 public Vector Mult(Vector vector, double k)
 {
     return new Vector(vector.A * k, vector.B * k);
 }
Esempio n. 4
0
 //Multiply Skalyar vectors
 public double MultSkalyar(Vector vector)
 {
     return (A * B + vector.A * vector.B);
 }
Esempio n. 5
0
 //Minus vectors;
 public Vector Minus(Vector vector)
 {
     return new Vector(A - vector.A, B - vector.B);
 }