# [Solved] How to calculate transition from movement speed to rotation speed?

Hi all,

At this moment, I am trying to figure out how to calculate the rotation speed for my game.
In the game, you can move a forward and upon touching the screen, you transition into the rotation state.

When in rotation state, you rotate around a given point with an offset. This is done by the following code:

``````currentGrappleAngle += grappleSpeed;
targetPosition.y = rb.position.y;
targetPosition += grapplePoint.position;
rb.MovePosition(targetPosition);
``````

Here, the position is calculated using (co)sines which get the current angle. The result of this is then multiplied by the offset (radius) to get the required position.

Now, the grappleSpeed is the thing that determines how fast this rotating happens.
The problem lies at how this is calculated. At this moment this is being calculated the following way:

``````(currentSpeed - radius) * Time.deltaTime;
``````

Current speed is the magnitude the rigidbody travels, where radius is the offset distance. This does not work as I want however. Most of the time, you can see a slight difference in speed when transitioning, but other times, it clearly has a different speed.

Does anyone with better math skills than me have an idea of how I can fix this problem?