> For the complete documentation index, see [llms.txt](https://docs.openbrim.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openbrim.org/developers/paramml-developer-guide/functions/custom-function/linesplit-line-listofrelativedistances-or-linesplit-line-numberofsegments.md).

# linesplit (line, ListofRelativeDistances) or linesplit (line, NumberofSegments)

Given a line defined by its start and end points, along with desired relative distances, this function lists the coordinates of points on the line precisely at the specified relative distances. The relative value of (0) corresponds to the start of the line, while the relative value of (1) corresponds to the end of the line. Thus, a relative value of (0.5) signifies the midpoint of the line.

Or,

Given a line defined by its start and end points, and a specified number of segments for division, this function divides the line into the provided number of segments and lists the starting and ending points of each new segment.

**linesplit (line, ListofRelativeDistances) → List of coordinates**

**linesplit (line, NumberofSegments) → List of coordinates**

This function is used for splitting the lines based on given relative distances or number of segments.

**Example:**

```xml
<O N="linesplitObject1" T="Project">
    <!-- created by ParamML Examples on 8/22/2023 -->
    <P N="line" V="[[4,3],[10,12]]" />
    <P N="SplittedLines1" V="linesplit(line,[0,0.4,0.75,1])" />
    <P N="SplittedLines2" V="linesplit(line,2)" />
</O>
```

![](https://openbrim.atlassian.net/wiki/download/attachments/2167701562/image-20230822-155924.png?api=v2) As illustrated above, the line is splitted at the given relative distances in the parameter **SplittedLines1** while the line is splitted in to 2 segments in the **SplittedLines2.** To view this example in the library, see (<https://openbrim.org/app/?incubator=1&author=ParamML_Examples_OpenBrIM+Platform&obj=objid0cpvktmhmt8670dyjde3ip> )


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.openbrim.org/developers/paramml-developer-guide/functions/custom-function/linesplit-line-listofrelativedistances-or-linesplit-line-numberofsegments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
