liveBook · Manning

Line segment

A line segment is the finite portion of a straight line bounded by two endpoints.

How 4 Manning books explain it

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.

Read how Geometry for Programmers explains line segment →

Math for Web Design

A line segment is the finite portion of a line between two endpoints.

How it is used
Represents straight, finite edges and movement paths in web layouts and drawing interfaces.
How deep it goes
Defines segments by two endpoints or one point and a direction vector, without developing line equations.
Examples
Shows a canvas stroke from (50, 50) to (250, 100) and an element moving between two points.
What you can do after
Apply it via JavaScript canvas methods to draw between specified points, or understand a straight movement path.

Read how Math for Web Design explains line segment →

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.

Read how Just Use Postgres! explains line segment →

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.

Read how How Computers Make Books explains line segment →

Also covered in

Related concepts

Questions about line segment

What is line segment?

A line segment is the finite portion of a straight line bounded by two endpoints.

Which Manning books explain line segment?

Geometry for Programmers, Math for Web Design, Just Use Postgres! and How Computers Make Books.

What is line segment a kind of?

Line segment is a kind of line. A line is a one-dimensional straight geometric set extending indefinitely in both directions, commonly represented by a linear equation.

What is line segment part of?

Line segment is part of polyline. A polyline is a geometric path formed by an ordered sequence of connected straight line segments.

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.