#include <psychlops.h>
using namespace Psychlops;

Psychlops::Rectangle rect1;
Psychlops::Color col1;
double width=200;
double height=100;
double lambda=60;
double lmean=0.5, contrast=1.0, theta=0;
double speed=PI/90;

void psychlops_main() {

	Canvas sampleA(Canvas::fullscreen);
	while(!Input::get(Keyboard::spc)){
		rect1.set(1,height);
		for(int i=0;i<width;i++){
			col1.set(lmean*((contrast*sin((2*PI*i/lambda)+theta))+1));
			rect1.centering().shift((double)-1/2*width+i,0);
			rect1.draw(col1);
		}
	sampleA.flip();
	theta+=speed;
	}
} 