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
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.

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 →

Related concepts

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.