Advance Unity 2d apply circle Rotation-z with mouse

Sorry I’m new to this,
I am trying to rotate a circle from A to B with mouse.position, but I would like that the next time I receive a new mouse.position the circle rotates in z from the last position (B) to C, can someone help me ?
Thanks


current code:

    Vector2 positionOnScreen = Camera.main.WorldToViewportPoint(transform.position);

        
        Vector2 mouseOnScreen = (Vector2)Camera.main.ScreenToViewportPoint(Input.mousePosition);
       
       
        angle = AngleBetweenTwoPoints(positionOnScreen, mouseOnScreen);

        
//apply Rotation
        transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, angle));


        float AngleBetweenTwoPoints(Vector3 a, Vector3 b)
        {
            return Mathf.Atan2(a.y - b.y, a.x - b.x) * Mathf.Rad2Deg;
        }

Hello.

You just need to apply your last rotation every time. So every time you rotate, need to store its final rotation for the next time:

 transform.rotation =  LastRotation + Quaternion.Euler(new Vector3(0f, 0f, angle));
 LastRotation = transform.rotation;

Bye !