let div2 = document.querySelector('.div2')
function(){ //外汇返佣 http://www.fx61.com/
let r = 25 //摇杆的半径
let r2 = 100 //底盘的半径
let x = div2.offsetLeft + r //加上r半径的偏移到中心
let y = div2.offsetTop + r
div3.ontouchmove = (e) => {
let t = e.changedTouches[0]
//开根 触摸点到摇杆中心点的距离
let d = Math.sqrt(Math.pow(t.pageX - x, 2) + Math.pow(t.pageY - y, 2))
d=d>(r2-r)?r2-r:d
//三角函数求反正切 减去xy偏移到中心点
let radin = Math.atan2(t.pageY - y, t.pageX - x)
let vx = x + Math.cos(radin) * d
let vy = y + Math.sin(radin) * d