function drawCircle(x0,y0,r,res) { if (res==undefined) res = 50; //circle resolution beginShape(); var step = Math.PI * 2.0 / res; for (var a=0; a= 1.0 ? 1 : 0; zf = Math.min(zxMax, zyMax); // if (dir == 1 && zf < 1.0) zf = 1; // console.log("orgZF, zxMax, zyMax, finZF: " + oldZF + ", " + zxMax + ", " + zyMax + ", " + zf); return { x: delta.x, y: delta.y, zf: zf }; } } function nearestZero(v1, v2) { return Math.abs(v1) < Math.abs(v2) ? v1 : v2; } //*draws* a circle (i.e. it is not added as points to shape) function drawCircleTemp(x, y, r, color) { ctx.beginPath(); ctx.lineWidth = 1; ctx.fillStyle = color; ctx.arc(x, y, r, 0, 2 * Math.PI, false); ctx.fill(); ctx.stroke(); ctx.fillStyle = 'black'; }