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

## CanvasContext.arc

> [VERSION] Base Library >= 2.21.8

### Description

Create an arc

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `x` | `number` | Yes | x-coordinate of the circle center |
| `y` | `number` | Yes | y-coordinate of the circle center |
| `r` | `number` | Yes | Radius of the circle |
| `sAngle` | `number` | Yes | Start angle, in radians (at the 3 o'clock position) |
| `eAngle` | `number` | Yes | End angle |
| `counterclockwise` | `boolean` | No | Whether counterclockwise |

### Return Value

None


### Examples

#### Draw a circle

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.beginPath();
ctx.arc(100, 75, 50, 0, 2 * Math.PI);
ctx.setFillStyle('#ff0000');
ctx.fill();
ctx.draw();
```
