double at(int index) { if (index == 0) { return x; } if (index == 1) { return y; } throw RangeError('index out of range'); }