[從頭學數學] 第216節 帶著電腦去高考(八)

來源:互聯網
上載者:User

標籤:

劇情提要:
[機器小偉]在[工程師阿偉]的陪同下進入了[九轉金丹]之第八轉的修鍊。設想一個情境:
如果允許你帶一台不連網的電腦去參加高考,你會放棄選擇一個手拿計算機和草稿本嗎
?阿偉決定和小偉來嘗試一下用電腦算高考題會是怎樣的感覺。

正劇開始:

星曆2016年05月21日 11:31:19, 銀河系厄爾斯星球中華帝國江南行省。
[工程師阿偉]正在和[機器小偉]一起做著2007年的江蘇省數學高考題]。




這一年的卷子又回到了比較低的難度,感覺這就是正弦曲線的節奏。





<span style="font-size:18px;">//題1if (1) {              var r = 20;                    config.setSector(1,1,1,1);                      config.graphPaper2D(0, 0, r);                    config.axis2D(0, 0,180);                                      //座標軸設定                var scaleX = 2*r, scaleY = 2*r;                  var spaceX = 90, spaceY = 0.5;                   var xS = -720, xE = 720;                  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 = [];                                    //需要顯示的函數說明                        //希臘字母表(存此用於Ctrl C/V              //ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ              //αβγδεζηθικλμνξοπρστυφχψω          var f1 = 'y = sinx/2', f2 = 'y = sin2x', f3 = 'y = cosx/4', f4 = 'y = cos4x';                var  y1 = y2 = y3 = y4 = 0;var  x1 = 0;//(1-(x+2)^2)^0.5for (var x = xS; x <= xE; x+=10) { x1 = x/180*Math.PI;y1 = Math.sin(x1/2);y2 = Math.sin(2*x1);y3 = Math.cos(x1/4);y4 = Math.cos(4*x1);a.push([x, y1]);b.push([x, y2]);c.push([x, y3]);d.push([x, y4]);        }                                      //存放臨時數組                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, 100, -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, 100, -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, 100, -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, 100, -180, 200);             }        } </span>









<span style="font-size:18px;">//題3if (1) {              var r = 20;                    config.setSector(1,1,1,1);                      config.graphPaper2D(0, 0, r);                    config.axis2D(0, 0,180);                                      //座標軸設定                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 = [];                                    //需要顯示的函數說明                        //希臘字母表(存此用於Ctrl C/V              //ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ              //αβγδεζηθικλμνξοπρστυφχψω          var f1 = 'y^2 - x^2/4 = 1', f2 = '', f3 = '', f4 = '';                var  y1 = y2 = y3 = y4 = 0;var  x1 = 0;var asqare = 4, bsqare = 1;//(1-(x+2)^2)^0.5for (var x = xS; x <= xE; x+=0.5) { y1 = Math.pow((x*x/asqare+1)*bsqare, 0.5);a.push([x, y1]);a.push([x, -y1]);        }                                      //存放臨時數組                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, 30, -90, 200);              }   }</span>







<span style="font-size:18px;">//題5if (1) {              var r = 20;                    config.setSector(1,1,1,1);                      config.graphPaper2D(0, 0, r);                    config.axis2D(0, 0,180);                                      //座標軸設定                var scaleX = 2*r, scaleY = 2*r;                  var spaceX = 90, spaceY = 0.5;                   var xS = -720, xE = 720;                  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 = [];                                    //需要顯示的函數說明                        //希臘字母表(存此用於Ctrl C/V              //ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ              //αβγδεζηθικλμνξοπρστυφχψω          var f1 = 'y = sinx-1.732cosx', f2 = '', f3 = '', f4 = '';                var  y1 = y2 = y3 = y4 = 0;var  x1 = 0;//(1-(x+2)^2)^0.5for (var x = xS; x <= xE; x+=10) { x1 = x/180*Math.PI;y1 = Math.sin(x1) - 1.732*Math.cos(x1);a.push([x, y1]);        }                                      //存放臨時數組                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('#880000');                plot.fillText(f1, 100, -90, 200);              }    </span>




<span style="font-size:18px;">#題7def tmp7():    A_0 = alg.strformat(['a_[0]']);    A_1 = alg.strformat(['a_[1]']);    A_2 = alg.strformat(['a_[2]']);    A_3 = alg.strformat(['a_[3]']);        C_1 = alg.strformat(['x', '-2']);    C_2 = alg.strcombine(alg.strpow_n(C_1, 2));    C_3 = alg.strcombine(alg.strpow_n(C_1, 3));    D = A_0 + alg.strdot(A_1, C_1)+alg.strdot(A_2, C_2)+alg.strdot(A_3, C_3);    D = alg.strcombine(D);    print(D);    '''    ['(1)*a_[0]^[1]', '(1)*a_[1]^[1]*x^[1]', '(-2)*a_[1]^[1]', '(1)*a_[2]^[1]*x^[2]', '(-4)*a_[2]^[1]*x^[1]',    '(4)*a_[2]^[1]', '(1)*a_[3]^[1]*x^[3]',    '(-6)*a_[3]^[1]*x^[2]', '(12)*a_[3]^[1]*x^[1]', '(-8)*a_[3]^[1]']    '''    E = ['(1)*a_[0]^[1]', '(1)*a_[1]^[1]*x^[1]', '(-2)*a_[1]^[1]', '(1)*a_[2]^[1]*x^[2]', '(-4)*a_[2]^[1]*x^[1]',    '(4)*a_[2]^[1]', '(1)*x^[3]', '(-6)*x^[2]', '(12)*x^[1]', '(-8)'];    E = alg.strcombine(E);    print(E);    F = ['(1)*a_[0]^[1]', '(1)*a_[1]^[1]*x^[1]', '(-2)*a_[1]^[1]', '(1)*a_[2]^[1]*x^[2]', '(-4)*a_[2]^[1]*x^[1]',         '(4)*a_[2]^[1]', '(1)*x^[3]', '(-6)*x^[2]', '(12)*x^[1]', '(-8)']    #-6 + a_[2] = 0;</span>





<span style="font-size:18px;">//題8if (1) {              var r = 20;                    config.setSector(1,1,1,1);                      config.graphPaper2D(0, 0, r);                    config.axis2D(0, 0,180);                                      //座標軸設定                var scaleX = 2*r, scaleY = 2*r;                  var spaceX = 2, spaceY = 0.5;                   var xS = -10, xE = 10;                  var yS = -20, yE = 20;                  config.axisSpacing(xS, xE, spaceX, scaleX, 'X');                    config.axisSpacing(yS, yE, spaceY, scaleY, 'Y');                                        var transform = new Transform();                    //存放函數映像上的點                var a = [], b = [], c = [], d = [];                                    //需要顯示的函數說明                        //希臘字母表(存此用於Ctrl C/V              //ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ              //αβγδεζηθικλμνξοπρστυφχψω          var f1 = 'y = log(2/(1-x))', f2 = '', f3 = '', f4 = '';                var  y1 = y2 = 0;//(1-(x+2)^2)^0.5for (var x = xS; x <= xE; x+=0.2) { y1 = Math.log(2/(1-x))/Math.log(10);a.push([x, y1]);        }                                      //存放臨時數組                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, 100, -90, 200);                  }  }</span>








<span style="font-size:18px;">//題8if (1) {              var r = 20;                    config.setSector(1,1,1,1);                      config.graphPaper2D(0, 0, r);                    config.axis2D(0, 0,180);                                      //座標軸設定                var scaleX = 2*r, scaleY = 2*r;                  var spaceX = 2, spaceY = 0.5;                   var xS = -10, xE = 10;                  var yS = -20, yE = 20;                  config.axisSpacing(xS, xE, spaceX, scaleX, 'X');                    config.axisSpacing(yS, yE, spaceY, scaleY, 'Y');                                        var transform = new Transform();                    //存放函數映像上的點                var a = [], b = [], c = [], d = [];                                    //需要顯示的函數說明                        //希臘字母表(存此用於Ctrl C/V              //ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ              //αβγδεζηθικλμνξοπρστυφχψω          var f1 = 'y = log(2/(1-x))', f2 = '', f3 = '', f4 = '';                var  y1 = y2 = 0;//(1-(x+2)^2)^0.5for (var x = xS; x <= xE; x+=0.2) { y1 = Math.log(2/(1-x))/Math.log(10);a.push([x, y1]);        }                                      //存放臨時數組                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, 100, -90, 200);                  }  }</span>









<span style="font-size:18px;">//題15if (1) {              var r = 20;                    config.setSector(1,1,1,1);                      config.graphPaper2D(0, 0, r);                    config.axis2D(0, 0,180);                                      //座標軸設定                var scaleX = 2*r, scaleY = 2*r;                  var spaceX = 2, spaceY = 10;                   var xS = -10, xE = 10;                  var yS = -50, yE = 50;                  config.axisSpacing(xS, xE, spaceX, scaleX, 'X');                    config.axisSpacing(yS, yE, spaceY, scaleY, 'Y');                                        var transform = new Transform();                    //存放函數映像上的點                var a = [], b = [], c = [], d = [];                                    //需要顯示的函數說明                        //希臘字母表(存此用於Ctrl C/V              //ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ              //αβγδεζηθικλμνξοπρστυφχψω          var f1 = 'y = x^3-12x+8', f2 = '', f3 = '', f4 = '';                var  y1 = y2 = 0;//(1-(x+2)^2)^0.5for (var x = xS; x <= xE; x+=0.2) { y1 = Math.pow(x, 3) - 12 * x + 8;a.push([x, y1]);        }                                      //存放臨時數組                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, 100, -90, 200);                  }  </span>




<span style="font-size:18px;">#題16def tmp16():    #寫出邊長和座標點    AB = AC = BC = 2 *1.732;    A, B, C = [0, 0, 0], [AB, 0, 0], [AB/2, AB*1.732/2, 0];    P = [AB/2, AB*1.732/6, 2];    panel = geo.Panel();    d = panel.pt2panel(A, [P, B, C]);    print(d);>>> 2.6832028613289456>>> 6/5*5**0.52.6832815729997477</span>















本節到此結束,欲知後事如何,請看下回分解。

[從頭學數學] 第216節 帶著電腦去高考(八)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.