liveBook · Manning

Line segment

As explained in How Computers Make Books

A line segment is the finite straight connection between two points.

A line segment is the finite straight connection between two points. In a coordinate drawing, its endpoints can define it: (1, 1)—(6, 3). Reversing the endpoints describes the same segment. Although ordinary mathematics reserves “line” for an infinite length, drawing discussions may use “line” informally for a segment. section 1.3

On paper or a screen, a segment becomes a pattern of dots. A shallow segment is approximated by choosing a nearby dot in each column; a steep one works better with one dot in each row. Higher resolution and gray shades make the result look smoother. section 1.3

Line segments become useful building blocks because:

  • Joining several segments creates polygons and more elaborate outlines. section 1.4
  • A coordinate sequence can describe an outline, which can then be converted from vector graphics into colored raster dots. section 1.4

A square from four segments

The segments (1, 1)—(10, 1), (10, 1)—(10, 10), (10, 10)—(1, 10), and (1, 10)—(1, 1) form a square. Writing the endpoints in sequence gives a compact description of the outline. section 1.4

Figure 1.6 A line defined by the coordinates of its two endpoints

Use the endpoint-coordinate figure to see how a segment is specified before it is approximated with screen or paper dots. section 1.3

How How Computers Make Books covers it

How deep it goes
Defines segments by endpoints and explains row-column dot selection, but stops short of a complete drawing algorithm.
Examples
Uses the segment (1, 1)—(6, 3), a square, and a coordinate-based outline of a simple house.
What you can do after
Apply it via endpoint coordinates to sketch segments, choose suitable raster sampling, and construct polygonal outlines.
How it connects
Connects line segments with coordinates, raster graphics, vector graphics, shapes, slopes, and anti-aliasing.

Also explained in

Compare how 4 books explain line segment →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Computers Make Books. The section links point to the parts of the book it draws on.