How to get the growth of an angle from touch

I am trying to figure out how to get the delta angle of a touch. To elaborate, I want to know by how much my angle increased or decreased based on the movement of my finger across the screen.

I’ve included an image for clarification.

21743-example.jpg

T1 is the touch. If T1 increases along the tangent of the point (0, 0), the delta is ZERO as the angle is not changing. If T1 increases towards the bottom of the screen and the movement is constant, then the growth is +1 per frame, or however fast the finger is moving.
I already know how to do this for plain position, i.e Delta Touch, but I’m not sure how to do it with regards to an angle.

Any help or ideas are most welcome :slight_smile:

You don’t say if your origin is in screen or world coordinates. If it is in world coordinates, you will need to do a Camera.WorldToScreenPoint() so that your touch and origin are in the same coordinate system. As for calculating the angle, you can use Mathf.Atan2(). Pseudo code:

var dir = touchPos - originPos;
var angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;

‘angle’ will be zero when ‘dir’ is equal to Vector3.right. I don’t know how you are using this angle, but Mathf.DeltaAngle() will give you change between two angles either from some starting angle or from frame to frame.