---
title: "relativeLine(to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbezierpath/relativeline(to:)"
---

# relativeLine(to:)

Appends a straight line segment to the path starting at the current point and moving towards the specified point, relative to the current location.

## Declaration

```swift
func relativeLine(to point: NSPoint)
```

## Parameters

- `point`: A point whose coordinates are interpreted as a relative offset from the current point.

## Discussion

Discussion The destination point is relative to the current point. For example, if the current point is (1, 1) and aPoint contains the value (1, 2), a line segment is created between the points (1, 1) and (2, 3). You must set the path’s current point (using the move(to:) method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an genericException exception.

## See Also

### Constructing a Path

- [move(to:)](appkit/nsbezierpath/move(to:).md)
- [line(to:)](appkit/nsbezierpath/line(to:).md)
- [curve(to:controlPoint1:controlPoint2:)](appkit/nsbezierpath/curve(to:controlpoint1:controlpoint2:).md)
- [curve(to:controlPoint:)](appkit/nsbezierpath/curve(to:controlpoint:).md)
- [close()](appkit/nsbezierpath/close().md)
- [relativeMove(to:)](appkit/nsbezierpath/relativemove(to:).md)
- [relativeCurve(to:controlPoint1:controlPoint2:)](appkit/nsbezierpath/relativecurve(to:controlpoint1:controlpoint2:).md)
- [relativeCurve(to:controlPoint:)](appkit/nsbezierpath/relativecurve(to:controlpoint:).md)
