public static void Main()
Console.WriteLine("Hello World");
public double X { get; set; }
public double Y { get; set; }
public Vector(double x, double y)
public double this[int index]
if (index == 0) { return X; }
else if(index == 1) { return Y;}
else { throw new IndexOutOfRangeException(); }
if (index == 0) { X = value; }
else if (index == 1) { Y = value; }
else { throw new IndexOutOfRangeException(); }
public static Vector operator +(Vector v1, Vector v2)
return new Vector(v1.X + v2.X, v1.Y + v2.Y);
public static Vector operator +(Vector v, double scalar)
return new Vector(v.X + scalar, v.Y + scalar);
public static Vector operator -(Vector v)
return new Vector(-v.X, -v.Y);
public static bool operator ==(Vector v1, Vector v2)
return ((v1.X == v2.X) && (v1.Y == v2.Y));
public static bool operator !=(Vector v1, Vector v2)