Vector2D.this C# (CSharp) Method

this() public method

public this ( int i ) : double
i int
return double
    public double this[int i]
    {
        get { return i==0?x:y; }
        set {
            switch (i){
            case 0:
                x = value;
                break;
            case 1:
                y = value;
                break;

            default:
                throw new System.Exception("Out of range "+i);
            }
        }
    }