# CurveToY Class

> A curveto operator where the second control point matches the end point.

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

```cpp
class CurveToY : Segment
```

**Namespace:** `datalogics_interface`

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

## Description

A curveto operator where the second control point matches the end point.

Here the new current point is the end point in the curve.

The name CurveToY is drawn from the "Y" path construction operator.

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

## Constructors

### CurveToY

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

*constructor*

**Parameters**

- `p1` ([`const Point &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)): the first 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 point3 as the Bézier control points. The new current point is point3.

### CurveToY

```cpp
datalogics_interface::CurveToY::CurveToY(double x1, double y1, double x3, double y3)
```

*constructor*

**Parameters**

- `x1` (`double`): the first control point.
- `y1` (`double`): the new current point.
- `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 point3 as the Bézier control points. The new current point is point3.

### ~CurveToY

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

*destructor*

## Methods

### point1

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

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

The single off-curve control point (the end point is reused as the second control point).

### point3

```cpp
Point datalogics_interface::CurveToY::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::CurveToY::to_string() const override
```

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

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