Adds a point to the current subpath by using the specified control points that represent a quadratic Bézier curve.

## Parameters

cp1x [in]

Type: number

The x-coordinate of the Bézier control point.

cp1y [in]

Type: number

The y-coordinate of the Bézier control point.

x [in]

Type: number

The x-coordinate of the point to add to the current path.

y [in]

Type: number

The y-coordinate of the point to add to the current path.

## Return value

This method does not return a value.

## Remarks

A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the existing current subpath. If a path does not exist, use the beginPath and moveTo methods to set a starting point.

## Examples

The following code example uses quadraticCurveTo to draw an arc.

```
<html>
<script type="text/javascript">
function beginDemo() {
var canvas = document.getElementById("demo")
var ctx = canvas.getContext('2d');
// Draw a straight reference line.
ctx.beginPath();
ctx.strokeStyle = "blue";
ctx.moveTo(100, 100);
ctx.lineTo(300, 100);
ctx.stroke();
// Draw a quadratic curve by using the same line coordinates.
ctx.beginPath();
ctx.lineWidth = "3";
ctx.strokeStyle = "black";
ctx.moveTo(100, 100);
ctx.stroke();
}
</script>
<canvas id="demo" width="400" height="400"></canvas>
</body>
</html>

```