正剧开始:
星历2016年04月05日 10:41:44, 银河系厄尔斯星球中华帝国江南行省。
[工程师阿伟]正在和[机器小伟]一起研究[锐角三角函数 小结与复习题]。
<span style="font-size:18px;">//题1 if (1) { config.setSector(1,1,1,1); var r = 20; config.graphPaper2D(0, 0, r); config.axis2D(0, 0, 190); //绘制三角形 var triangle = new Triangle(); //此处两边分别为AB,即第一二两顶点,BC, 即二三两顶点,直角为C var array = triangle.know2edges([6, 2], -90); var scale = 2*r; shape.angleDraw([].concat(array), 'red', scale, 'ABC'); //求角的三角函数值 var angle = 19.47 / 180*Math.PI; var sinA = Math.sin(angle), cosA = Math.cos(angle), tanA = Math.tan(angle); //打印结果 var x = -200, y = -170; var result = []; result.push(['sinA = ', sinA]); result.push(['cosA = ', cosA]); result.push(['tanA = ', tanA]); for (var i = 0; i < 3; i++) { plot.fillText(result[i][0]+result[i][1].toFixed(3), x, y, 100); y += 30; } //求角的三角函数值 angle = Math.PI/2- angle; sinA = Math.sin(angle); cosA = Math.cos(angle); tanA = Math.tan(angle); //打印结果 x = -200, y = 30; result = []; result.push(['sinB = ', sinA]); result.push(['cosB = ', cosA]); result.push(['tanB = ', tanA]); for (var i = 0; i < 3; i++) { plot.fillText(result[i][0]+result[i][1].toFixed(3), x, y, 100); y += 30; } }</span>
<span style="font-size:18px;">#题4, 5 cos76°39' = 0.231 sin17°52' = 0.307 sin57°18' = 0.842 tan22°20' = 0.411 tan83°6' = 8.264 cos4°59' = 0.996 tan12°30' = 0.222 sin15° = 0.259 acos0.7651 = 40°5'3″ asin0.9343 = 69°6'55″ atan35.26 = 88°22'32″ atan0.707 = 35°15'37″ task = [ ['cos', 76, 39], ['sin', 17, 52], ['sin', 57, 18], ['tan', 22, 20], ['tan', 83, 6], ['cos', 4, 59], ['tan', 12, 30], ['sin', 15], ['acos', 0.7651], ['asin', 0.9343], ['atan', 35.26], ['atan', 0.707] ];</span>
<span style="font-size:18px;">#题13 >>> 边数为3,圆内接正多边形的周长为5.196152422706632, 面积为1.2990381056766582 边数为4,圆内接正多边形的周长为5.65685424949238, 面积为2.0 边数为5,圆内接正多边形的周长为5.877852522924732, 面积为2.377641290737884 边数为6,圆内接正多边形的周长为5.999999999999999, 面积为2.5980762113533156 边数为7,圆内接正多边形的周长为6.074372347645814, 面积为2.7364101886381045 边数为8,圆内接正多边形的周长为6.1229349178414365, 面积为2.8284271247461903 边数为9,圆内接正多边形的周长为6.156362579862037, 面积为2.8925442435894273 此时圆周长为6.283185307179586, 面积为3.141592653589793 def tmp(): import math; R = 1; edge = 0; for edge in range(3, 10): #半圆心角 angle = 2*math.pi/edge/2; h = R*math.cos(angle); a = R*math.sin(angle)*2; #周长 C = edge*a; #面积 S = edge*a*h/2; print('边数为{0},圆内接正多边形的周长为{1}, 面积为{2}'.format(edge, C, S)); print('此时圆周长为{0}, 面积为{1}'.format(2*math.pi*R, math.pi*R*R));</span>
本节到此结束,欲知后事如何,请看下回分解。