Comment by waqf

9 years ago

Yes, that explains why it's correct to first order.

But the mystery is that experimentally it's more correct than that. Why does it seem to join up with itself exactly after 360°, and not spiral slightly inward or outward due to accumulated error? Why does it stop working if you use a temporary variable so that x and y are updated simultaneously instead of alternately?

Due to the addition and subtraction, errors introduced in the x step are effectively canceled out in the y step, and vice-versa. This is also the reason why the path is slightly elliptical --- at some points there is slightly too much y and not enough x, at other points not enough y and too much x, and the other two combinations (for the other two quadrants) too. However, all the errors cancel out so the path goes back to where it started.