예제 #1
0
 public VectorPM Subcract(VectorPM v2)
 {
     VectorPM vector = new VectorPM();
     vector.XAxis -= v2.XAxis;
     vector.YAxis -= v2.YAxis;
     return vector;
 }
예제 #2
0
 public VectorPM Add(VectorPM v2)
 {
     VectorPM vector = new VectorPM();
     vector.XAxis += v2.XAxis;
     vector.YAxis += v2.YAxis;
     return vector;
 }
예제 #3
0
        static void Main(string[] args)
        {
            int SizeHeight = Console.LargestWindowHeight;
            int SizeWidth = Console.LargestWindowWidth;
            Console.BufferHeight = SizeHeight;
            Console.WindowHeight = SizeHeight;
            Console.BufferWidth = SizeWidth;
            Console.WindowWidth = SizeWidth;
            //Console.SetCursorPosition(SizeWidth / 2, SizeHeight / 2);
            //Console.Write("yoyo");

            //SolarSystem Game = new SolarSystem();

            VectorPM v1 = new VectorPM();
            VectorPM v2 = new VectorPM();
            VectorPM v3 = new VectorPM();
            v1.Place(10, 10);
            v2.Place(20, 20);

           
            Console.ReadKey();

            for (int i = 0; i < 10; i++)
            {
                v1.Velocity(5, 5);
                System.Threading.Thread.Sleep(500);
                
            }

            Console.ReadKey();
        }
예제 #4
0
        public VectorPM Divide(double val)
        {
            VectorPM vector = new VectorPM();
            double X = this.XAxis / val;
            double Y = this.YAxis / val;

            vector.XAxis = X;
            vector.YAxis = Y;
            return vector;
        }
예제 #5
0
        public VectorPM Multiply(double val)
        {
            VectorPM vector = new VectorPM();
            double X = this.XAxis * val;
            double Y = this.YAxis * val;

            vector.XAxis = X;
            vector.YAxis = Y;
            return vector;
        }
예제 #6
0
 public void SubtractFrom(VectorPM v2)
 {
     this.XAxis -= v2.XAxis;
     this.YAxis -= v2.YAxis;
 }
예제 #7
0
 public void AddTo(VectorPM v2)
 {
     this.XAxis += v2.XAxis;
     this.YAxis += v2.YAxis;
 }