double low=-2*Math.PI; double high=2*Math.PI;
int []xPoints = new int[size.width];
int []yPoints = new int[size.width];
for(int i=0;i<size.width;i++){
xPoints[i] = i;
yPoints[i] = size.height/2 -(int)(size.height/3*Math.sin(low+i*(high-low)/size.width));
}
g.drawPolyline(xPoints, yPoints, size.width);
}