---
name: "CanvasContext.rotate"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "rotate"
---

## CanvasContext.rotate

> [VERSION] Base Library >= 2.21.8

### Description

Rotate the current coordinate system clockwise around the origin

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `rotate` | `number` | Yes | Rotation angle, in radians |

### Return Value

None


### Examples

#### Rotate

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.rotate((20 * Math.PI) / 180);
ctx.fillRect(50, 10, 100, 50);
ctx.draw();
```
