How to rotate an object around a fixed point by

So I’m working on a mobile game and I want to rotate the purple rectangle around the red square in reference to the center of the square by swiping. In addition I want the rectangle to move with the speed of the swipe. Here is a picture for demonstration (the circles represent the swipe of the finger):

Thank you for your help!

Might be you’re looking for Transform.RotateAround