zoukankan      html  css  js  c++  java
  • [从头学数学] 第159节 反比例函数 小结与复习题

    剧情提要:
    [机器小伟]在[project师阿伟]的陪同下进入了筑基后期的修炼,
    这次要修炼的目标是[反比例函数 小结与复习题]。



    正剧開始:

    星历2016年04月03日 09:50:19, 银河系厄尔斯星球中华帝国江南行省。


    [project师阿伟]正在和[机器小伟]一起研究[反比例函数 小结与复习题]。










    <span style="font-size:18px;">	if (1) {
    	
    		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 = [], d = [];  
              
    		//须要显示的函数说明
    		var f1 = 'y=2/x', f2 = 'y=2/|x|', f3 = 'y=-2/x', f4 = 'y=-2/|x|';
    		//函数描点
    		
    		var x = xS;
    		
    		while (x <= xE) {
    			if (Math.abs(x) <= 2) {
    				x += 0.25;
    			}
    			else {
    				x += 1;
    			}
    			
    			if (x != 0) {
    				//a.push([x, 2/x]);  
    				//b.push([x, 2/Math.abs(x)]);  
    				//c.push([x, -2/x]);
    				d.push([x, -2/Math.abs(x)]);
    
    			}
    		}
    			
            
    		//存放暂时数组
    		var tmp = [];
              
            //显示变换
    		if (a.length > 0) {
    			a = transform.scale(transform.translate(a, 0, 0), scaleX/spaceX, scaleY/spaceY); 
    			//函数1
    			tmp = [].concat(a);    
    			shape.pointDraw(tmp, 'red');    
    			tmp = [].concat(a);    
    			shape.multiLineDraw(tmp, 'pink');  
    			  
    			plot.setFillStyle('red');
    			plot.fillText(f1, 200, -90, 200);  
    		}
    		
    		if (b.length > 0) {
    			b = transform.scale(transform.translate(b, 0, 0), scaleX/spaceX, scaleY/spaceY);  		    
    			//函数2
    			tmp = [].concat(b);    
    			shape.pointDraw(tmp, 'blue');    
    			tmp = [].concat(b);    
    			shape.multiLineDraw(tmp, '#22CCFF'); 
    			
    			plot.setFillStyle('blue');
    			plot.fillText(f2, 200, -120, 200); 
    
    		}
             
    		if (c.length > 0) {
    			c = transform.scale(transform.translate(c, 0, 0), scaleX/spaceX, scaleY/spaceY);  
    			tmp = [].concat(c);    
    			shape.pointDraw(tmp, 'green');    
    			tmp = [].concat(c);    
    			shape.multiLineDraw(tmp, '#CCFF22');  
    			plot.setFillStyle('green');  
    			plot.fillText(f3, 200, -150, 200); 
    		}
    		
    		if (d.length > 0) {
    			d = transform.scale(transform.translate(d, 0, 0), scaleX/spaceX, scaleY/spaceY);  
    			tmp = [].concat(d);    
    			shape.pointDraw(tmp, 'orange');    
    			tmp = [].concat(d);    
    			shape.multiLineDraw(tmp, '#CC8800');  
    			plot.setFillStyle('orange');  
    			plot.fillText(f4, 200, -180, 200); 
    		}
    
             
    
    	}
    	
    </span>



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

  • 相关阅读:
    10大开源文档管理系统,知识管理系统
    okhttp原理,okhttp为什么好?
    开放式创新对程序开发有什么深远的影响?
    TypeScript中文手册【从入门到精通】
    CentoOS6 32停更了,如何继续用yum源【解决方案】
    electronic为什么要用JavaScript开发桌面应用
    统一身份认证登录入口,统一用户认证和单点登录解决方案
    PHP数组如何倒叙 array_reverse
    Windows electron开发实例大全
    AI深度学习的基础上处理自然语言
  • 原文地址:https://www.cnblogs.com/zhchoutai/p/7133601.html
Copyright © 2011-2022 走看看