public Vector Add(Vector vector) { Vector result = new Vector(); result.X = this.X + vector.X; result.Y = this.Y + vector.Y; return result; }
public Vector Subtract(Vector vector) { Vector result = new Vector(); result.X = this.X - vector.X; result.Y = this.Y - vector.Y; return result; }
public Vector Reflect(Vector unitVector) { double dotProduct = this.Dot(unitVector); Vector reflection = unitVector.Multiply(2 * dotProduct).Subtract(this); return reflection; }
public Vector Multiply(double scaleFactor) { Vector result = new Vector(); result.X = this.X + scaleFactor; result.Y = this.Y + scaleFactor; return result; }
public double Dot(Vector vector) { double result = 0.0f; result = this.X * vector.X + this.Y * vector.Y; return result; }