Calculating rotation degrees based on delta x,y movement of touch or mouse
<p>I have an object in 2D space that I want to rotate based on how an input in 2D space moves. Basically, think that you move your finger or mouse around on the screen either clockwise or counter clockwise, and the object rotates relative to how you rotate your finger. The position of the object does not matter at all, meaning the rotation is only translated to the object from the finger movement, and there is no relation between the object's position and the finger movement position.</p>

<p>I am using libGdx and I get the X and Y delta movement (positive and negative integers depending on direction of movement) in a call to a method "touchDragged". </p>

<p>How can I use this delta X and Y to calculate the degrees of movement that I can then apply to my object. Preferably I'd just like to add to a radian or degree value.</p>

<p>I can get it to work fine if only using one axis. I.e. if I move the finger up or down, or rotates either clock-wise or counter-clockwise. My problem is getting it to work as a result of both X and Y movement.</p>

<p>PS: I did a bit of looking around before posting this question and I know there are similar questions but I couldn't figure it out based on them. I don't know exactly why but it seemed like all the different questions were tackling different use cases each one different from mine.</p>