Recently someone mentioned sinewaves, to which Don referred to Hardware Hacker #85 (page 77ish:
Well, I tried it, and the first cycle looks sinusoidal, but there's LF oscillation or something on it, too.
Give this QBasic code a run:
-=-=-=-
SCREEN 12 DEFINT A-Z
DIM Buffer(639)
x = 100 Rate = 0 Clip = 10
DO IF x > 0 THEN Rate = Rate - 1 ELSE Rate = Rate + 1 IF Rate > Clip THEN x = x + Clip ELSEIF y < -Clip THEN x = x - Clip ELSE x = x + Rate END IF Buffer(j) = x j = j + 1 IF j >= 640 THEN j = 0
k = j WAIT &H3DA, 8 FOR i = 0 TO 638 PRESET (i, 240 - Buffer(k) * 2) k = k + 1 IF k >= 640 THEN k = 0 NEXT k = j + 1 IF k >= 640 THEN k = 0 FOR i = 0 TO 638 PSET (i, 240 - Buffer(k) * 2) k = k + 1 IF k >= 640 THEN k = 0 NEXT LOOP UNTIL INKEY$ = CHR$(27)
-=-=-=-
Ironically, I tried good old Newton's method on d^2x/dt^2 - x = 0 and got a fair looking circle (with quadrature, no less). Rounding errors are moderate, but I don't know how good the stability is, which is always the problem with numerical methods.
Bresenham's circle drawing algoritm is another related one.
Tim