這是我從網上尋找的,centerx鼠標點擊獲取的clientx,endx鼠標移動獲取的e.clientx,360 Math.atan2(diff_y, diff_x) z這個360是使用360度嗎,實在是看不懂var diff_x = endx - centerx, // 是怎么個原理
diff_y = endy - centery // 是怎么個原理var c = 360 * Math.atan2(diff_y, diff_x) / (2 * Math.PI)
為什么最后要用360+cc = c <= -90 ? (360 + c) : creturn c + 90
添加回答
舉報
0/150
提交
取消