正剧开始:
星历2016年03月24日 11:44:36, 银河系厄尔斯星球中华帝国江南行省。
[工程师阿伟]正在和[机器小伟]一起研究[二次函数]。
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = r; var spaceX = 2, spaceY = 50; var xS = -10, xE = 10; var yS = -100, yE = 600; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = []; for (var x = xS; x <= xE; x+=spaceX) { a.push([x, 6*x*x]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink');</span>
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 2, spaceY = 20; var xS = -10, xE = 10; var yS = -10, yE = 100; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = []; for (var x = xS; x <= xE; x+=spaceX) { a.push([x, x*x]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.fillText('y=x^[2]', 100, -100, 200);</span>
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 2, spaceY = 20; var xS = -10, xE = 10; var yS = -10, yE = 100; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX) { a.push([x, 0.5*x*x]); b.push([x, 2*x*x]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.fillText('y=0.5*x^[2]', 100, -100, 200); plot.fillText('y=2*x^[2]', 100, -150, 200); tmp = [].concat(b); shape.pointDraw(tmp, 'blue'); tmp = [].concat(b); shape.multiLineDraw(tmp, '#22CCFF'); /* tmp = [].concat(c); shape.pointDraw(tmp, 'green'); tmp = [].concat(c); shape.multiLineDraw(tmp, '#CCFF22');*/ </span>
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 1, spaceY = 2; var xS = -5, xE = 5; var yS = -5, yE = 12; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX/5) { a.push([x, 2*x*x+1]); b.push([x, 2*x*x-1]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.setFillStyle('red'); plot.fillText('y=2*x^[2]+1', 100, -100, 200); plot.setFillStyle('blue'); plot.fillText('y=2*x^[2]-1', 100, -150, 200); tmp = [].concat(b); shape.pointDraw(tmp, 'blue'); tmp = [].concat(b); shape.multiLineDraw(tmp, '#22CCFF'); /* tmp = [].concat(c); shape.pointDraw(tmp, 'green'); tmp = [].concat(c); shape.multiLineDraw(tmp, '#CCFF22');*/</span>
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,1,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 1, spaceY = 2; var xS = -5, xE = 5; var yS = -12, yE = 12; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX/5) { a.push([x, -0.5*(x+1)*(x+1)-1]); b.push([x, -0.5*x*x]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.setFillStyle('red'); plot.fillText('y = -0.5*(x+1)*(x+1)-1', 100, 100, 200); plot.setFillStyle('blue'); plot.fillText('y=-0.5*x*x', 100, 150, 200); tmp = [].concat(b); shape.pointDraw(tmp, 'blue'); tmp = [].concat(b); shape.multiLineDraw(tmp, '#22CCFF'); /* tmp = [].concat(c); shape.pointDraw(tmp, 'green'); tmp = [].concat(c); shape.multiLineDraw(tmp, '#CCFF22');*/</span>
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 1, spaceY = 0.5; var xS = -5, xE = 5; var yS = -2, yE = 3; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX/5) { a.push([x, -0.75*(x-1)*(x-1)+3]); //b.push([x, -0.5*x*x]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); //b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.setFillStyle('red'); plot.fillText('y = -0.75*(x-1)*(x-1)+3', 100, 100, 200);</span>
<span style="font-size:18px;"> var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 1, spaceY = 1; var xS = -5, xE = 5; var yS = -2, yE = 8; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX/5) { a.push([x, x*x-2*x-2]); //b.push([x, -0.5*x*x]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); //b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.setFillStyle('red'); plot.fillText('y = x*x-2*x-2', 100, 100, 200);</span>
var equation = new Equation(); var a = [1, -2, -2]; equation.quadratic(a);
var r = 20; config.setSector(1,1,1,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0,180, 1.5); var scaleX = 2*r, scaleY = 2*r; var spaceX = 2, spaceY = 2; var xS = -10, xE = 10; var yS = -10, yE = 10; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX/5) { a.push([x, x*x-2*x-3]); b.push([x, -x*x-4*x-3]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.setFillStyle('red'); plot.fillText('y = x*x-2*x-3', 100, -100, 200); plot.setFillStyle('blue'); plot.fillText('y=-x*x-4*x-3', 100, 150, 200); tmp = [].concat(b); shape.pointDraw(tmp, 'blue'); tmp = [].concat(b); shape.multiLineDraw(tmp, '#22CCFF'); /* tmp = [].concat(c); shape.pointDraw(tmp, 'green'); tmp = [].concat(c); shape.multiLineDraw(tmp, '#CCFF22');*/
var r = 20; config.setSector(5,1,4,1); config.graphPaper2D(0, 0, r); config.axis2D(0, 0, 260, 1); var scaleX = 2*r, scaleY = 2*r; var spaceX = 2, spaceY = 10; var xS = -10, xE = 10; var yS = -10, yE = 100; config.axisSpacing(xS, xE, spaceX, scaleX, 'X'); config.axisSpacing(yS, yE, spaceY, scaleY, 'Y'); var transform = new Transform(); var a = [], b = [], c = []; for (var x = xS; x <= xE; x+=spaceX/5) { a.push([x, -5*x*x+30*x]); //b.push([x, -x*x-4*x-3]); } a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); //b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY); var tmp = [].concat(a); shape.pointDraw(tmp, 'red'); tmp = [].concat(a); shape.multiLineDraw(tmp, 'pink'); plot.setFillStyle('red'); plot.fillText('y = -5*x*x+30*x', 100, -100, 200);
本节到此结束,欲知后事如何,请看下回分解。