defsng a-z
const sw = 800
const sh = 600
declare SUB ccircle (x1, y1, r, col)
declare SUB cline (x1, y1, x2, y2, col)
declare FUNCTION yc (x)
declare FUNCTION yb (x)
declare FUNCTION ya (x)
SCREEN 12
CALL cline(0, 0, sw / 2, 0, 7)
CALL cline(0, 0, -sw / 2, 0, 7)
CALL cline(0, 0, 0, sh / 2, 7)
CALL cline(0, 0, 0, -sh / 2, 7)
zoom = 75
CALL ccircle(-2 * zoom, ya(-2) * zoom, 10, 14)
CALL ccircle(1 * zoom, yb(1) * zoom, 10, 15)
FOR x = -2.5 TO 2 STEP .01
CALL ccircle(x * zoom, ya(x) * zoom, 1, 14)
CALL ccircle(x * zoom, yb(x) * zoom, 1, 15)
'CALL ccircle(x * zoom, yc(x) * zoom, 1, 5)
a = -2/27
b = -7/36
c = 10/9
d = 11/27
y = a*x*x*x + b*x*x + c*x + d
pset (x*zoom + sw/2, sh/2 - y*zoom)
NEXT
sleep
system
END
FUNCTION ya (x)
ya = -x ^ 2 / 4 - 1
END FUNCTION
FUNCTION yb (x)
yb = x ^ 2 / 4 + 1
END FUNCTION
FUNCTION yc (x)
yc = x ' What should this be in order to smoothly join each curve?
END FUNCTION
SUB cline (x1, y1, x2, y2, col)
LINE (sw / 2 + x1, -y1 + sh / 2)-(sw / 2 + x2, -y2 + sh / 2), col
END SUB
SUB ccircle (x1, y1, r, col)
CIRCLE (sw / 2 + x1, -y1 + sh / 2), r, col
END SUB