From 4a64a2f57f93e3d3eebb6027006281b20c9174e8 Mon Sep 17 00:00:00 2001 From: Jeffrey Sun Date: Thu, 15 Dec 2016 13:39:02 -0800 Subject: [PATCH] bezier curves and kappa --- js/fox.js | 4 +- server.js | 135 +++++++++++++++++++++--------------------------------- 2 files changed, 54 insertions(+), 85 deletions(-) diff --git a/js/fox.js b/js/fox.js index 40359a3..0bcdd0c 100644 --- a/js/fox.js +++ b/js/fox.js @@ -41,8 +41,8 @@ var Fox = function (IMG_WIDTH, IMG_HEIGHT) { }, head: { origin: origin, - headWidth: headWidth, - headHeight:headHeight + width: headWidth, + height: headHeight }, ears: ears, eyes: eyes, diff --git a/server.js b/server.js index 356aeca..d709a98 100644 --- a/server.js +++ b/server.js @@ -2,37 +2,37 @@ var Fox = require('./js/fox.js'); var davis = require('./js/davis.js'); var geo = require('./js/geo.js'); -var ngon = function (c) { - var n=c.n || 3; - - var ctx= c.context || false; - var x=c.x || 500; - var y=c.y || x; - var r=c.r || 500; - if (n%2==0){ - var rotation=360/(n*2)*davis.random(n*2); - } - else { - var rotation=90+(180*davis.random(2)); - }; - rotation=c.rotation || rotation; - var color=c.color || davis.randomColor("grey"); - var lineWidth=c.lineWidth || 1; - var fill=c.fill || davis.randcomColor(); - ctx.beginPath(); - for (var i=0;i