Line 1: | Line 1: | ||
{{NEU_China_B}} | {{NEU_China_B}} | ||
<html> | <html> | ||
+ | |||
<canvas id="base_page" width="800" height="400" style="border:1px solid #c3c3c3;" class="center-block"> | <canvas id="base_page" width="800" height="400" style="border:1px solid #c3c3c3;" class="center-block"> | ||
您的浏览器不支持 HTML5 canvas 标签。 | 您的浏览器不支持 HTML5 canvas 标签。 | ||
Line 40: | Line 41: | ||
var t5 = 0; | var t5 = 0; | ||
var base_t5 = base_t4 + during; | var base_t5 = base_t4 + during; | ||
+ | |||
+ | var x_e = 200; | ||
+ | var y_e = 100; | ||
function redraw() { | function redraw() { | ||
Line 46: | Line 50: | ||
var i = 0; | var i = 0; | ||
ctx.beginPath(); | ctx.beginPath(); | ||
− | var x = | + | var x = x_e * Math.cos(0 * 180 * 2) + basex; |
− | var y = | + | var y = y_e * Math.sin(0 * 180 * 4) + basey; |
ctx.moveTo(x, y); | ctx.moveTo(x, y); | ||
for (i = 0; i < 0.05; i += 0.00001) { | for (i = 0; i < 0.05; i += 0.00001) { | ||
− | var x = | + | var x = x_e * Math.cos(i * 180 * 2) + basex; |
− | var y = | + | var y = y_e * Math.sin(i * 180 * 4) + basey; |
ctx.lineTo(x, y); | ctx.lineTo(x, y); | ||
} | } | ||
Line 110: | Line 114: | ||
t5 = i + base_t5; | t5 = i + base_t5; | ||
− | var img1_x = | + | var img1_x = x_e * Math.cos(t1 * 180 * 2) + basex; |
− | var img1_y = | + | var img1_y = y_e * Math.sin(t1 * 180 * 4) + basey; |
drawImg(imgWarpper1, img1_x, img1_y); | drawImg(imgWarpper1, img1_x, img1_y); | ||
− | |||
− | var img2_x = | + | var img2_x = x_e * Math.cos(t2 * 180 * 2) + basex; |
− | var img2_y = | + | var img2_y = y_e * Math.sin(t2 * 180 * 4) + basey; |
imgWarpper2.x = img2_x; | imgWarpper2.x = img2_x; | ||
imgWarpper2.y = img2_y; | imgWarpper2.y = img2_y; | ||
Line 124: | Line 127: | ||
− | var img3_x = | + | var img3_x = x_e * Math.cos(t3 * 180 * 2) + basex; |
− | var img3_y = | + | var img3_y = y_e * Math.sin(t3 * 180 * 4) + basey; |
drawImg(imgWarpper3, img3_x, img3_y); | drawImg(imgWarpper3, img3_x, img3_y); | ||
− | var img4_x = | + | var img4_x = x_e * Math.cos(t4 * 180 * 2) + basex; |
− | var img4_y = | + | var img4_y = y_e * Math.sin(t4 * 180 * 4) + basey; |
drawImg(imgWarpper4, img4_x, img4_y); | drawImg(imgWarpper4, img4_x, img4_y); | ||
− | var img5_x = | + | var img5_x = x_e * Math.cos(t5 * 180 * 2) + basex; |
− | var img5_y = | + | var img5_y = y_e * Math.sin(t5 * 180 * 4) + basey; |
drawImg(imgWarpper5, img5_x, img5_y); | drawImg(imgWarpper5, img5_x, img5_y); | ||
Line 191: | Line 194: | ||
</script> | </script> | ||
+ | |||
<hr> | <hr> |
Revision as of 14:19, 16 October 2018