Line
✖
Line
Details and Options

- Line is also known as poly-line or line-segments.
- Line can be used as a geometric region or a graphics primitive.
- Line represents a piecewise linear curve where the segment from pi to pi+1 is given by
.
- Line can be used in Graphics and Graphics3D.
- In graphics, the points pi can be Scaled, Offset, ImageScaled, and Dynamic expressions.
- Graphics rendering is affected by directives such as Thickness, Dashing, JoinForm, CapForm, and color.
- The following options and settings can be used in graphics:
-
VertexColors None vertex colors to be interpolated VertexNormals None effective vertex normals for shading - Line can be used with symbolic points in GeometricScene.

Background & Context
- Line is a graphics and geometry primitive that represents a geometric line segment or sequence of connected line segments (a "poly-line"). The location of a Line connecting
points in
-dimensional space is specified as a list argument consisting of
sublists, with each sublist containing
Cartesian coordinate values. The coordinate sublists of Line objects may consist of exact or approximate values, where RegionEmbeddingDimension can be used to determine the dimension
for a given Line expression. A collection of lines (or poly-lines) may be represented as a nested lists of
-tuples inside a single Line primitive (a "multiline"). The coordinates of Line objects may have exact or approximate values.
- Line objects can be visually formatted in two and three dimensions using Graphics and Graphics3D, respectively. Line objects can also be used in geographical maps using GeoGraphics and GeoPosition (e.g. GeoGraphics[Line[GeoPosition[{{38.9,-77.0},{40.1,-88.3}}]]]). In addition, Line may serve as a region specification over which a computation should be performed.
- While lines themselves have dimension 1 (as reported by the RegionDimension function) with zero thickness, Line objects in formatted graphics expressions are by default styled to appear "thicker" than a one-dimensional mathematical line. Furthermore, in graphical visualizations, lines are displayed at the same size regardless of varying distances from the view point. The appearance of Line objects in graphics can be modified by specifying thickness directives such as Thickness, AbsoluteThickness, Thick, and Thin; dashing directives such as Dashing, AbsoluteDashing, Dashed, Dotted, and DotDashed; edge and cap directives EdgeForm and CapForm; color directives such as Red; the transparency directive Opacity; and the style option Antialiasing. In addition, the colors of multilines may be specified using VertexColors, while the shading and simulated lighting of multilines within Graphics3D may be specified using VertexNormals.
- GeometricTransformation and more specific transformation functions such as Translate and Rotate can be used to change the coordinates at which a Line object is displayed while leaving the underlying Line expression untouched.
- Other graphics primitives such as Tube, Arrow, HalfLine, and InfiniteLine may resemble those of stylized Line objects. While poly-lines consist only of straight line segments, smooth curves may be constructed via splines using BSplineCurve or BezierCurve or via an interpolating function using Interpolation. A function related to Line as a geometric region is Interval, which interprets pairs of numbers as endpoints of a line segment lying on the number line and which can be directly operated on using arithmetic and relational operators.
- While the Line primitive explicitly appears in graphics and geometric region specification expressions, it should be noted that coordinates are commonly represented as bare lists in other contexts in the Wolfram Language. However, a number of graphics functions including Plot, ParametricPlot, ParametricPlot3D, and ContourPlot return graphical expressions that explicitly include Line objects.
Examples
open allclose allBasic Examples (4)Summary of the most common use cases

https://wolfram.com/xid/0haxw-bgla6


https://wolfram.com/xid/0haxw-flckz1


https://wolfram.com/xid/0haxw-ho51ix

https://wolfram.com/xid/0haxw-e65am0


https://wolfram.com/xid/0haxw-faw0nx

https://wolfram.com/xid/0haxw-h5set8

Compute the ArcLength of a line:

https://wolfram.com/xid/0haxw-bocko4


https://wolfram.com/xid/0haxw-ciwitf

Scope (24)Survey of the scope of standard use cases
Graphics (14)
Specification (3)
Styling (8)
Lines with different thicknesses:

https://wolfram.com/xid/0haxw-ctsr8t


https://wolfram.com/xid/0haxw-lyw0li


https://wolfram.com/xid/0haxw-gpgy0g

Thickness in printer's points:

https://wolfram.com/xid/0haxw-c0zwps


https://wolfram.com/xid/0haxw-phyxev


https://wolfram.com/xid/0haxw-exlmkl


https://wolfram.com/xid/0haxw-dj8wfk

Line caps can be specified using CapForm:

https://wolfram.com/xid/0haxw-icyy0n


https://wolfram.com/xid/0haxw-2y2qo

Joining of line segments can be specified using JoinForm:

https://wolfram.com/xid/0haxw-bnj940


https://wolfram.com/xid/0haxw-fk5l81

Colors can be specified at vertices using VertexColors:

https://wolfram.com/xid/0haxw-cn0av


https://wolfram.com/xid/0haxw-gff7zx

Normals can be specified at vertices using VertexNormals for 3D lines:

https://wolfram.com/xid/0haxw-hqxpxd

Coordinates (3)
Use Scaled coordinates:

https://wolfram.com/xid/0haxw-cuyath


https://wolfram.com/xid/0haxw-bwu21r

Use ImageScaled coordinates in 2D:

https://wolfram.com/xid/0haxw-h1zfoi

Use Offset coordinates in 2D:

https://wolfram.com/xid/0haxw-2qad5

Regions (10)
Embedding dimension is the dimension of the space in which the line lives:

https://wolfram.com/xid/0haxw-y220


https://wolfram.com/xid/0haxw-5k5s20


https://wolfram.com/xid/0haxw-bx9tom


https://wolfram.com/xid/0haxw-lkww90


https://wolfram.com/xid/0haxw-6krfo4

https://wolfram.com/xid/0haxw-p3b1hx

Get conditions for point membership:

https://wolfram.com/xid/0haxw-2p4iz


https://wolfram.com/xid/0haxw-bpai91

https://wolfram.com/xid/0haxw-z6qch


https://wolfram.com/xid/0haxw-69kuzf


https://wolfram.com/xid/0haxw-3feta


https://wolfram.com/xid/0haxw-oc6hy

https://wolfram.com/xid/0haxw-bjikjq


https://wolfram.com/xid/0haxw-da2zys

Signed distance from a line segment:

https://wolfram.com/xid/0haxw-cybvpc

https://wolfram.com/xid/0haxw-bm4ed

Signed distance to a line segment:

https://wolfram.com/xid/0haxw-g7ezsg


https://wolfram.com/xid/0haxw-btejnv

https://wolfram.com/xid/0haxw-et4yza


https://wolfram.com/xid/0haxw-eoyt0e

https://wolfram.com/xid/0haxw-bidbt6


https://wolfram.com/xid/0haxw-ngi1ht

https://wolfram.com/xid/0haxw-b5d6xy


https://wolfram.com/xid/0haxw-drm66k


https://wolfram.com/xid/0haxw-mdwqe8

Integrate over a polygonal curve:

https://wolfram.com/xid/0haxw-fivgav

https://wolfram.com/xid/0haxw-banwkr

Optimize over a polygonal curve:

https://wolfram.com/xid/0haxw-nf9ton

https://wolfram.com/xid/0haxw-eamzcm

Solve equations in a polygonal curve:

https://wolfram.com/xid/0haxw-bnrw6

https://wolfram.com/xid/0haxw-c7lkth


https://wolfram.com/xid/0haxw-h06b54

Options (3)Common values & functionality for each option
VertexColors (2)
Applications (6)Sample problems that can be solved with this function

https://wolfram.com/xid/0haxw-ol22x

https://wolfram.com/xid/0haxw-dsedf3

The tangent bundle for a quadratic curve:

https://wolfram.com/xid/0haxw-fsovn0

https://wolfram.com/xid/0haxw-bamczv

https://wolfram.com/xid/0haxw-sr0br


https://wolfram.com/xid/0haxw-daj2ji

2D random walk on a regular lattice:

https://wolfram.com/xid/0haxw-ljh4

3D random walk on a regular lattice:

https://wolfram.com/xid/0haxw-bmmzlr

Replace Polygon with Line to have special rendering effects:

https://wolfram.com/xid/0haxw-d9e2di

https://wolfram.com/xid/0haxw-mxiar9


https://wolfram.com/xid/0haxw-fr390h

Use a random collection of light sources:

https://wolfram.com/xid/0haxw-bpe0hl

https://wolfram.com/xid/0haxw-ggwj9n


https://wolfram.com/xid/0haxw-hde79v

Use lines to estimate the length of a curve:

https://wolfram.com/xid/0haxw-gbk19z

https://wolfram.com/xid/0haxw-gjtk16

https://wolfram.com/xid/0haxw-chqri1

https://wolfram.com/xid/0haxw-n56jd6


https://wolfram.com/xid/0haxw-cp6fn


https://wolfram.com/xid/0haxw-dw5k9

Increase the number of line segments for a better estimate:

https://wolfram.com/xid/0haxw-dgts5m

Properties & Relations (4)Properties of the function, and connections to other functions
Several visualization functions produce Line objects:

https://wolfram.com/xid/0haxw-elzn28

https://wolfram.com/xid/0haxw-wk9d0

Use directive styles appropriate for lines:

https://wolfram.com/xid/0haxw-ctestx

You can also transform the output:

https://wolfram.com/xid/0haxw-enz5r6


https://wolfram.com/xid/0haxw-b4a7ja

This shows the points at which it was sampled:

https://wolfram.com/xid/0haxw-cdrgcw

ImplicitRegion can be used to represent any Line region:

https://wolfram.com/xid/0haxw-tzgsvz

https://wolfram.com/xid/0haxw-xldpp9

ParametricRegion can be used to represent any Line region:

https://wolfram.com/xid/0haxw-hw5ae3

https://wolfram.com/xid/0haxw-kdkcer

Possible Issues (1)Common pitfalls and unexpected behavior
Line objects need to be specified using numbers that can be represented by machine numbers:

https://wolfram.com/xid/0haxw-iunjob


https://wolfram.com/xid/0haxw-b4yass

Neat Examples (4)Surprising or curious use cases

https://wolfram.com/xid/0haxw-b4jqea


https://wolfram.com/xid/0haxw-shu78


https://wolfram.com/xid/0haxw-b5cv10


https://wolfram.com/xid/0haxw-gjji4w

Tangent vectors along an elliptic curve:

https://wolfram.com/xid/0haxw-fikg7b

Wolfram Research (1988), Line, Wolfram Language function, https://reference.wolfram.com/language/ref/Line.html (updated 2014).
Text
Wolfram Research (1988), Line, Wolfram Language function, https://reference.wolfram.com/language/ref/Line.html (updated 2014).
Wolfram Research (1988), Line, Wolfram Language function, https://reference.wolfram.com/language/ref/Line.html (updated 2014).
CMS
Wolfram Language. 1988. "Line." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/Line.html.
Wolfram Language. 1988. "Line." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/Line.html.
APA
Wolfram Language. (1988). Line. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Line.html
Wolfram Language. (1988). Line. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Line.html
BibTeX
@misc{reference.wolfram_2025_line, author="Wolfram Research", title="{Line}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Line.html}", note=[Accessed: 23-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_line, organization={Wolfram Research}, title={Line}, year={2014}, url={https://reference.wolfram.com/language/ref/Line.html}, note=[Accessed: 23-April-2025
]}