void setAt(int index, double value) { if (index == 0) { x = value; } else if (index == 1) { y = value; } else { throw RangeError('index out of range'); } }