Пример #1
0
        public static TVector2D operator *(TVector2D a, int y)
        {
            TVector2D c = new TVector2D();

            c.vector_sum_Cordinate[0] = a.vector_1_Cordinate[0] * a.vector_2_Cordinate[0] + a.vector_1_Cordinate[1] * a.vector_2_Cordinate[1];

            return(c);
        }
Пример #2
0
        public static TVector2D operator +(TVector2D a, TVector2D b)
        {
            TVector2D c = new TVector2D();

            c.vector_sum_Cordinate[0] = a.vector_1_Cordinate[0] + b.vector_2_Cordinate[0];
            c.vector_sum_Cordinate[1] = a.vector_1_Cordinate[1] + b.vector_2_Cordinate[1];

            return(c);
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введіть дві коодинати для двох векторів:");

            TVector2D vectors_2 = new TVector2D();

            double vector_AB = 0;

            vector_AB = vectors_2.VectorLength1(vector_AB);


            double vector_CD = 0;

            vector_CD = vectors_2.VectorLength2(vector_CD);


            Console.WriteLine(vectors_2);

            Console.WriteLine("{0}", vectors_2.ComparisonOfVectors(vector_AB, vector_CD));

            Console.WriteLine("Введіть три коодинати для двох векторів:");

            TVector3D vectors_3 = new TVector3D();

            vector_AB = 0;
            vector_AB = vectors_3.VectorLength1(vector_AB);

            vector_CD = 0;
            vector_CD = vectors_3.VectorLength2(vector_CD);


            Console.WriteLine(vectors_3);

            Console.WriteLine("{0}", vectors_3.ComparisonOfVectors(vector_AB, vector_CD));


            Console.ReadKey();
        }
Пример #4
0
 public TVector2D(TVector2D vectors)
 {
     vector_1_Cordinate = vectors.vector_1_Cordinate;
     vector_2_Cordinate = vectors.vector_2_Cordinate;
 }