> For the complete documentation index, see [llms.txt](https://learnpython.strivemath.com/p5-python-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/rotatey.md).

# rotateY()

### Example

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

### Syntax

```
rotateY(angle)
```

<table><thead><tr><th width="114.33333333333331">Input</th><th>Description</th></tr></thead><tbody><tr><td>angle</td><td>angle of rotation</td></tr></tbody></table>

### Full Example

<figure><img src="/files/8ORiR90ufuq0I22B7XLt" alt=""><figcaption></figcaption></figure>

<details>

<summary>Example Full Code</summary>

```python
def setup():
  createCanvas(300,300, WEBGL)

def draw():
  background(255, 79, 132)
  fill(112, 88, 255)
  stroke(176, 235, 51)
  strokeWeight(2)
  orbitControl()
  # draw3DAxes(100, (100, 50, 20))
  rotateY(frameCount)
  torus(100, 25)
  rotateY(-2*frameCount)
  cone(50, 50)
```

</details>

### Description

Rotates a shape around y-axis by the amount specified in angle parameter. The angles can be entered in either `RADIANS` or `DEGREES`, depending on the specified angleMode().

**Positive** angles rotates the space from **+z to +x** regardless of handedness.

<details>

<summary>Why is this the direction of rotation?</summary>

The reason is hidden in the mathematical convention of setting up axes such that:

* if one **extends his fingers** of your **Right Hand** in the +x direction
* then **curls his fingers** into +y direction
* his **thumb points** into the +z direction

This is called the **Right Hand Convention** (as if you did it with your left hand, it would fail! it would give the opposite direction). We can write this convention as **+x => +y => +z**.

Extending the sequence with the same order **+x => +y => +z => +x => +y** gives us the convention for rotations about the x-axis and the y-axis as well:

* about x-axis: **+y => +z => +x**
* about y-axis: **+z => +x => +y**

</details>

{% 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/rotatey.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
