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

## CanvasContext.bezierCurveTo

> [VERSION] Base Library >= 2.21.8

### Description

Create a cubic Bezier curve path

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `cp1x` | `number` | Yes | x-coordinate of the first Bezier control point |
| `cp1y` | `number` | Yes | y-coordinate of the first Bezier control point |
| `cp2x` | `number` | Yes | x-coordinate of the second Bezier control point |
| `cp2y` | `number` | Yes | y-coordinate of the second Bezier control point |
| `x` | `number` | Yes | x-coordinate of the end point |
| `y` | `number` | Yes | y-coordinate of the end point |

### Return Value

None


### Examples

#### Draw a cubic Bezier curve

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.beginPath();
ctx.moveTo(20, 20);
ctx.bezierCurveTo(20, 100, 200, 100, 200, 20);
ctx.stroke();
ctx.draw();
```
