Curves:
Java Essentials, P6.20.
Applet Source Code