---
title: "angledLineToX"
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
layout: manual
---

Create a line segment from the current 2-dimensional sketch origin

along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension.

```js
angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
```


### Arguments

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No |

### Returns

[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.


### Examples

```js
exampleSketch = startSketchOn('XZ')
  |> startProfileAt([0, 0], %)
  |> angledLineToX({ angle = 30, to = 10 }, %)
  |> line(end = [0, 10])
  |> line(end = [-10, 0])
  |> close()

example = extrude(exampleSketch, length = 10)
```

![Rendered example of angledLineToX 0](data:image/png;base64,[encoded data, 81356 characters])


