Sprite Rotation

How to ahceive this kind of rotaion in phaser

this.midpoint = {x:this.img.x,y:this.img.y}

function onMove(){

    let angle = 0, sp = this.startpoint, mp = this.midpoint;
    let p = {x:this.game.input.x, y:this.game.input.y};
    let sAngle = Math.atan2((sp.y-mp.y),(sp.x - mp.x));
    let pAngle = Math.atan2((p.y-mp.y),(p.x - mp.x));        

    angle = (  sAngle - pAngle) * 180/Math.PI;
    this.img.rotation -= angle
    this.startpoint = {x:p.x, y:p.y};


its working weirdly and rotates faster

kindly help

I see an image of a cat rotating, not really a sprite :smile:
Are you sure you’re in the right forum ? :wink: