# Rotate

The Rotate animation allows an object to be rotated by the midpoint as an offset.

## Rotate - Expression

As shown in Figure 1, we have the Math.random () function to rotate the object from its midpoint according to a random value that we generate on a selected object.

![Figure 1 : Rotate-Expression](https://3585470428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLGnZudlzfM63QD-_cp%2F-LkJ010_tDOwyJc8jVps%2F-LkJ0l4pF4YpnKBGyHTs%2FRotate_Expression.png?alt=media\&token=50905e0a-6506-4f90-9125-90a97786677c)

Figure 1 shows the min-max values on the right-hand form. In summary, the 0 degree angle corresponds to the min value and the 360 degree angle corresponds to the max value. In the example given above, the expression results between 0-100 and the object will rotate in the angle range of 0 to 360 degrees.

## Rotate - Tag

As shown in Figure 2, we can rotate-tag an object according to the selected variable value without writing code.

![Figure 2 : Rotate-Tag](https://3585470428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLGnZudlzfM63QD-_cp%2F-LkJ010_tDOwyJc8jVps%2F-LkJ2xkv2RfaBx44EolT%2FRotate_tag.png?alt=media\&token=c62c6d30-d019-4feb-bb39-d94d768894f6)

In the rotate-tag form of Figure 2;

* Variable : The variable to which we want to associate the Rotate animation
* Default Value : The angular position we want to display when the variable value of the object cannot be read or there is no communication. (For example,  for 0, 0 degrees of angular position)
* Min-Max : Min refers to the angular position of 0 degrees, Max refers to the angular position of 360 degrees.

{% hint style="info" %}
The Rotate animation allows only an object to be rotated from its midpoint. This may seem restrictive at first glance. However, you can get different rotation animations with a few techniques that you can apply during the drawing phase of the object you want to apply the rotate animation. The gauge objects in Figure 3 can be made with the Rotate animation.
{% endhint %}

![Figure 3 : Gauges](https://3585470428-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLGnZudlzfM63QD-_cp%2F-LkJ010_tDOwyJc8jVps%2F-LkJ5hbVirnkhGfMFt9Y%2FGauges.png?alt=media\&token=c31e8805-2ab6-47f1-80dd-5dc74bd83150)
