public VectorPM Subcract(VectorPM v2) { VectorPM vector = new VectorPM(); vector.XAxis -= v2.XAxis; vector.YAxis -= v2.YAxis; return vector; }
public VectorPM Add(VectorPM v2) { VectorPM vector = new VectorPM(); vector.XAxis += v2.XAxis; vector.YAxis += v2.YAxis; return vector; }
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(); }
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; }
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; }
public void SubtractFrom(VectorPM v2) { this.XAxis -= v2.XAxis; this.YAxis -= v2.YAxis; }
public void AddTo(VectorPM v2) { this.XAxis += v2.XAxis; this.YAxis += v2.YAxis; }