# CurveTo Class

> The curveto operator is used to draw a Bezier curve.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/CurveTo
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class CurveTo : Segment
```

**Namespace:** `datalogics_interface`

**Inherits from:** [`Segment`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Segment.md)

## Description

The curveto operator is used to draw a Bezier curve.

The curved segment is appended to a path.

The curveto operator calculates the curve between two endpoints, the current (beginning) point and the final (end) point, and in relation to two matching control points.

The control points define the nature of the curve between the two endpoints. These values are represented by a series of x and y coordinates.

**Uses types:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

## Constructors

### CurveTo

```cpp
datalogics_interface::CurveTo::CurveTo(const Point &p1, const Point &p2, const Point &p3)
```

*constructor*

**Parameters**

- `p1` ([`const Point &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)): the first control point.
- `p2` ([`const Point &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)): the second control point.
- `p3` ([`const Point &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)): the new current point.

Append a cubic Bézier curve to the current path. The curve extends from the current point to point3, using point1 and point2 as the Bézier control points. The new current point is point3.

### CurveTo

```cpp
datalogics_interface::CurveTo::CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
```

*constructor*

**Parameters**

- `x1` (`double`): the first control point.
- `y1` (`double`): the second control point.
- `x2` (`double`): the new current point.
- `y2` (`double`)
- `x3` (`double`)
- `y3` (`double`)

Append a cubic Bézier curve to the current path. The curve extends from the current point to point3, using point1 and point2 as the Bézier control points. The new current point is point3.

### ~CurveTo

```cpp
datalogics_interface::CurveTo::~CurveTo() override
```

*destructor*

## Methods

### point1

```cpp
Point datalogics_interface::CurveTo::point1() const
```

**Returns:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

The first off-curve control point.

### point2

```cpp
Point datalogics_interface::CurveTo::point2() const
```

**Returns:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

The second off-curve control point.

### point3

```cpp
Point datalogics_interface::CurveTo::point3() const
```

**Returns:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

The end point of the curve.

### to_string

```cpp
std::string datalogics_interface::CurveTo::to_string() const override
```

**Returns:** `std::string`

Represents a segment, or a single line, within a path.
