<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBezierPath/relativeLine(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBezierPath(im)relativeLineToPoint:"
  },
  "title" : "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.

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

## Parameters

`point`

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

## 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:)`](/documentation/AppKit/NSBezierPath/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 <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/genericException> exception.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)