package calculette;

import java.awt.Graphics;

import javax.swing.JPanel;

@Exercice(2)
public class CourbeSinus extends JPanel {
	private static final long serialVersionUID = 1L;
	
	@Override
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		int w=getWidth(); double dh=getHeight()/2;
		for(int i=0; i< w; i++){
			int j=i+1;
			g.drawLine(i,(int)(dh*(1-Math.sin(i/dh))),
					   j,(int)(dh*(1-Math.sin(j/dh))));
		}
	}
	
	
}
