[从头学数学] 第150节 二次函数

剧情提要:
[机器小伟]在[工程师阿伟]的陪同下进入了筑基后期的修炼,
这次要修炼的目标是[二次函数]。

正剧开始:

星历2016年03月24日 11:44:36, 银河系厄尔斯星球中华帝国江南行省。
[工程师阿伟]正在和[机器小伟]一起研究[二次函数]。


[从头学数学] 第150节 二次函数_第1张图片


<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>

[从头学数学] 第150节 二次函数_第2张图片



[从头学数学] 第150节 二次函数_第3张图片

<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>


[从头学数学] 第150节 二次函数_第4张图片


[从头学数学] 第150节 二次函数_第5张图片

<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>


[从头学数学] 第150节 二次函数_第6张图片

[从头学数学] 第150节 二次函数_第7张图片

<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>


[从头学数学] 第150节 二次函数_第8张图片


<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>


[从头学数学] 第150节 二次函数_第9张图片

[从头学数学] 第150节 二次函数_第10张图片

[从头学数学] 第150节 二次函数_第11张图片



<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>

方程 1x^[2] + -2x + -2 = 0 =>
Δ = b^[2] - 4ac = 12 ;
方程的解为:x1 = -0.7320508075688772, x2 = 2.732050807568877 ;
方程根与系数的关系:x1 + x2 = 2, x1 * x2 = -1.9999999999999996 ;


		var equation = new Equation();

		var a = [1, -2, -2];
		equation.quadratic(a);



[从头学数学] 第150节 二次函数_第12张图片

		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');*/

方程 1x^[2] + -2x + -3 = 0 =>
Δ = b^[2] - 4ac = 16 ;
方程的解为:x1 = -1, x2 = 3 ;
方程根与系数的关系:x1 + x2 = 2, x1 * x2 = -3 ;

方程 -1x^[2] + -4x + -3 = 0 =>
Δ = b^[2] - 4ac = 4 ;
方程的解为:x1 = -1, x2 = -3 ;
方程根与系数的关系:x1 + x2 = -4, x1 * x2 = 3 ;

[从头学数学] 第150节 二次函数_第13张图片

[从头学数学] 第150节 二次函数_第14张图片

		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);

[从头学数学] 第150节 二次函数_第15张图片

本节到此结束,欲知后事如何,请看下回分解。


你可能感兴趣的:([从头学数学] 第150节 二次函数)