Skip to content

Instantly share code, notes, and snippets.

@fiskurgit
Created May 5, 2016 13:17
Show Gist options
  • Select an option

  • Save fiskurgit/25d93b97ff8518d6e5c9b5c37517ebca to your computer and use it in GitHub Desktop.

Select an option

Save fiskurgit/25d93b97ff8518d6e5c9b5c37517ebca to your computer and use it in GitHub Desktop.
/*
10 REM Display of SIN(X)/X
20 MODE4
25 VDU19,0,4;0;19,1,3;0;
30 point=69
40 VDU29,640;200; :REM Set origin
50 FOR X=-640.1 TO 640 STEP 2
60 PLOTpoint,X,800*32*SIN(X/32)/X
70 NEXT X
80 END
*/
void setup(){
size(400, 400);
stroke(255,255,0);
noLoop();
}
void draw(){
background(0);
translate(width/2, height/2);
for(float x = -width/2; x < width/2 ; x+=0.5){
point(x,(sin(x/8) * 1200.0)/x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment