![example picture for rotate()](/images/reference/Py5Vector_rotate_0.png)
```python
def setup():
py5.translate(py5.width / 2, py5.height / 2)
py5.text_align(py5.CENTER, py5.CENTER)
v = py5.Py5Vector(0, 40)
py5.fill(0)
for i in range(1, 13):
v.rotate(-py5.TWO_PI / 12)
py5.text(f'{i}', v.x, -v.y)
py5.line(0, 0, 0, -30)
py5.line(0, 0, 20, 0)
```
![example picture for rotate()](/images/reference/Py5Vector_rotate_1.png)
```python
def setup():
py5.size(100, 100, py5.P3D)
py5.translate(10, 20, -20)
# rotate so the viewer can better see the shape
py5.rotate_z(0.5)
py5.rotate_y(-0.5)
v2 = py5.Py5Vector(60, 0, -30)
with py5.begin_shape(py5.TRIANGLE_FAN):
py5.vertex(0, 0, 0)
for i in range(16):
v2.rotate(-py5.TWO_PI / 15, dim='x')
py5.vertex(v2.x, v2.y, v2.z)
```