Skip to content

Instantly share code, notes, and snippets.

@ariaz
Created August 12, 2012 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariaz/3329373 to your computer and use it in GitHub Desktop.
Save ariaz/3329373 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false}}
var speed = 5;
var x = 250;
var fbase = 28.2296;
var omega0 = 2 * Math.PI * fbase;
var om = omega0 * 0.04681;
x0 = tributary.sw/2;
y0 = tributary.sh/2;
function circle(ctx, y, r){
ctx.fillStyle = "rgba(" + 383 + ","+ "255, 255, 0.16051)";
ctx.rotate(0);
ctx.beginPath();
ctx.arc(x0,y0,r,6,Math.PI*2, true);
ctx.closePath();
ctx.fill();
}
tributary.init = function(ctx) {
};
tributary.run = function(ctx,t) {
ctx.fillStyle = "#911B1B";
ctx.fillRect(0,0,tributary.sw, tributary.sh);
ctx.strokeStyle = "#572424";
ctx.strokeRect (1,1,tributary.sw-2,tributary.sh-2);
console.log(t);
var tt = Math.cos(t)/2;
var p;
p = [tt*100, tt];
circle(ctx,p,50);
circle(ctx,p,40);
// tributary.clear(); //helper function to clear the canvas
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment