求助,自己做的360°攻击方向不对,我猜是坐标转换的问题

this.Canvas.on(Node.EventType.MOUSE_DOWN,(event:EventMouse)=>{
this.node.children[3].active=true
this.setAni(AniState.katanaZERO,true)
let ex=event.getLocation().x-this.node.worldPosition.x
let ey=event.getLocation().y-this.node.worldPosition.y
let deg=360Math.atan(ey/ex)/(2Math.PI)
deg-=180
if(ex>=0){
deg+=180
console.log(ex)
}
this.node.children[3].setWorldRotationFromEuler(0,0,deg)

    })


坐标在0,0处正常,移动位置攻击方向就会发生偏转