FileDocCategorySizeDatePackage
Wavelet.javaAPI DocExample765Sun Feb 08 21:33:40 GMT 2004None

Wavelet

public class Wavelet extends Applet
Simple Applet demo, showing a math function.
author
Arthur Van Hoff, avh
author
Ian F. Darwin, http://www.darwinsys.com/

Fields Summary
Constructors Summary
Methods Summary
doublefunc(double x)
This is the function that is plotted.

		Dimension d = getSize();
		return (Math.cos(x/9) + Math.sin(x/3) + 1) * d.height / 4;
    
public voidpaint(java.awt.Graphics g)
Called by AWT when the window needs painting; just recompute all the data and draw it, since it's a simple calculation and simpler than precomputing and storing the data.

		Dimension d = getSize();
        for (int x = 0 ; x < d.width ; x++) {
			g.drawLine(x, 20+(int)func(x), x + 1, 20+(int)func(x + 1));
        }