Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Extension

Line extensions

Value Summary

InheritedFinite, 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:

See Also

MuPAD Functions

Was this topic helpful?