float freq = 2; float amp=-(height/4); void setup(){ size(1000,400); } void draw(){ background(0); //sizes int widthSquare = 10; stroke(122); //draw x lines int y=0; for (int i=0; i<((height)/widthSquare)+1; i++){ line (0,y,width,y); y+=widthSquare; } //draw y lines int x=0; for (int i=0; i<(width/widthSquare); i++){ line (x,0,x,height); x+=widthSquare; } //draw axies stroke(0,255,0); line (0,(height)/2,width,(height)/2);//x axis line (width/2,0,width/2,height);//y axis //draw sine wave stroke(0,255,0); float fx=(height/2)+(((height/2)+amp)*-sin((freq*TWO_PI/width))); for (int i=1; i