> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
