Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# Extension

Line extensions

## Value Summary

 Inherited Finite, Infinite, or SemiInfinite

## Graphics Primitives

ObjectsExtension Default Values
plot::Line2d, plot::Line3dFinite

## Description

Extension allows to extent a line segment to an infinite ray or an infinite line.

Lines of type plot::Line2d and plot::Line3d are defined by specifying two points through which the line passes. For example: plot::Line2d([x1, y1], [x2, y2]). The first point [x1, y1] corresponds to the attribute From, the second point [x2, y2] corresponds to the attribute To.

With Extension = Finite, a line segment from From to To is drawn.

With Extension = SemiInfinite, an infinite ray is drawn starting at From passing through To. The ray extends to the border of the ViewingBox.

With Extension = Infinite, an infinite line is drawn passing through From and To. The line extends in both directions to the border of the ViewingBox.

## Examples

### Example 1

We plot two lines with the default value Extension = Finite:

```plot(plot::Line2d([0, 0], [1, 1], Color = RGB::Blue),
plot::Line2d([1, 0], [2, 1], Color = RGB::Red),
ViewingBox = [-1..3, -1..3])```

Now, with Extension = SemiInfinite, the blue line becomes a ray extending to the ViewingBox in one direction:

```plot(plot::Line2d([0, 0], [1, 1], Color = RGB::Blue,
Extension = SemiInfinite),
plot::Line2d([1, 0], [2, 1], Color = RGB::Red),
ViewingBox = [-1..3, -1..3])```

With Extension = Infinite, the blue line extends to the ViewingBox in both directions:

```plot(plot::Line2d([0, 0], [1, 1], Color = RGB::Blue,
Extension = Infinite),
plot::Line2d([1, 0], [2, 1], Color = RGB::Red),
ViewingBox = [-1..3, -1..3])```

### Example 2

Here we define a finite line segment and use plot::modify to create an extended copy. It is drawn as an infinite dashed line:

```line := plot::Line2d([0, 0], [1, 1]):
plot(plot::modify(line, Extension = Infinite,
LineStyle = Dashed),
line, ViewingBox = [-1..2, -1..2]):```

`delete line:`