# rotate()

### Example

<div align="left"><figure><img src="/files/OfPk6mBvAbhO3iWwOgul" alt=""><figcaption></figcaption></figure></div>

```python
translate(width/2, height/2)
rotate(frameCount * 0.5)
trect(50, 50, 100, 100)
```

### Syntax

`rotate(angle)`

<table><thead><tr><th width="231">Input</th><th>Description</th></tr></thead><tbody><tr><td>angle</td><td>the angle of rotation in radians/degrees depending on angle mode</td></tr></tbody></table>

What is actually happening in the above example is 👇

<figure><img src="/files/gE2b5Sv2jEVkL9Dqfl2e" alt=""><figcaption></figcaption></figure>

### Description

The `rotate()` function is used to **rotate the coordinate system** by a specified angle **about the current origin**. This means that any subsequent drawing or transformation function will be affected by this rotation.

**Positive** angles will rotate the plane from **+x to +y**, so:

* In `BOTTOM_RIGHT` coordinate system, positive angles rotate counter-clockwise.
* In `BOTTOM_LEFT` coordinate system, positive angles rotate clockwise.

**Negative** angles rotate the plane from **+x to -y**

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/rotate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
