This is a good demonstration of anti-aliasing, since these curves would look quite nasty plotted with jaggy, pixellated, graphics.
The program will run equally well in BBC BASIC for SDL 2.0 and BBC BASIC for Windows (so long as it's new enough to include the AAGFXLIB library).
Code: Select all
10 INSTALL @lib$ + "aagfxlib"
20 ORIGIN 140,2
30 segs% = 128
40 DIM x(segs%), y(segs%)
50 FOR e% = -9 TO 9
60 FOR i% = 1 TO segs%
70 x = i% / segs%
80 IF e% >= 0 y = x ^ (e%+1) ELSE y = x ^ (1/(1-e%))
90 x(i%) = 1000 * x
100 y(i%) = 1000 * y
110 NEXT
120 C% = &FF000000 OR e% * &56789A
130 PROC_aapolyline(segs% + 1, x(), y(), 1.5, C%, 0)
140 NEXT e%