這是我從網(wǎng)上尋找的,centerx鼠標(biāo)點(diǎn)擊獲取的clientx,endx鼠標(biāo)移動(dòng)獲取的e.clientx,360 Math.atan2(diff_y, diff_x) z這個(gè)360是使用360度嗎,實(shí)在是看不懂var diff_x = endx - centerx, // 是怎么個(gè)原理
diff_y = endy - centery // 是怎么個(gè)原理var c = 360 * Math.atan2(diff_y, diff_x) / (2 * Math.PI)
為什么最后要用360+cc = c <= -90 ? (360 + c) : creturn c + 90
- 1 回答
- 0 關(guān)注
- 573 瀏覽
添加回答
舉報(bào)
0/150
提交
取消