Line segment
A line segment is the finite portion of a straight line bounded by two endpoints.
Geometry for Programmers
A finite portion of a line bounded by two endpoints.
- How it is used
- Deploys segments as curve-building blocks, distance-field boundaries, mesh primitives, and approximated contour pieces.
- How deep it goes
- Works through projection cases, distance formulas, smooth joining, and implementation trade-offs; stops short of a fully general curve treatment.
- Examples
- Uses arc-segment joins, rectangle signed distance functions, triangle meshes, and pixel-derived contours split into short segments.
- What you can do after
- Apply via Python and SymPy to calculate segment distances, construct rectangle distance fields, and represent or smooth geometric contours.
Math for Web Design
A line segment is the finite portion of a line between two endpoints.
- How it is used
- Uses segments to represent canvas strokes, element edges, and direct UI movement paths.
- How deep it goes
- Defines segments through endpoints and direction vectors, then relates them to bounding boxes without deriving segment-length formulas.
- Examples
- Shows cursor-coordinate sketching and a canvas line from (50, 50) to (250, 100).
- What you can do after
- Apply it via the Canvas API to draw straight paths and via coordinates or vectors to describe UI motion.
Just Use Postgres!
A line segment is a finite linear geometric object bounded by two endpoints or represented as part of a connected path.
- How it is used
- Uses linear geospatial features to classify, measure, and locate roads or other objects within geographic boundaries.
- How deep it goes
- Explains segment representation and demonstrates length and intersection queries, without developing geometric theory.
- Examples
- Uses OSM-derived highways, roads, rivers, Miami boundaries, road classifications, point counts, and measured lengths.
- What you can do after
- Apply it via PostGIS to group road types, measure LineStrings, and find geometries intersecting a city boundary.
How Computers Make Books
A line segment is the finite straight connection between two points.
- How it is used
- Uses line segments to define drawable marks and assemble outlines for raster images.
- 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.
Related concepts
- linekind of · A line is a one-dimensional straight geometric set extending indefinitely in both directions, commonly represented by a linear equation.
- polylinepart of · A polyline is an ordered sequence of connected straight line segments represented by successive points.
- straight-line drawingused by · A straight-line drawing is a graph drawing in which every edge is represented by a straight line segment between its endpoint vertices.
- parametric cubicproduces · A parametric cubic is a degree-three curve whose coordinates are polynomial functions of a parameter.
- set intersectionuses · Set intersection is the set of elements that belong to every one of two or more sets.
- linekind of · A line is a contiguous sequence of text characters ending at a line boundary or the end of a text stream.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



