liveBook · Manning

Euclidean distance

Euclidean distance is the straight-line distance between two points in Euclidean space, calculated as the square root of the sum of squared differences between corresponding coordinates.

How 8 Manning books explain it

Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

Euclidean distance is the straight-line distance between two points calculated from the square root of the sum of squared coordinate differences.

How it is used
Supplies a straight-line heuristic for maze search and a distance measure for k-means data points.
How deep it goes
Derives the two-dimensional formula from geometry and implements it for maze locations and data points with any number of dimensions.
Examples
Uses a Swift maze-location function and a three-dimensional point pair whose distance is approximately 4.123.
What you can do after
Build it from scratch as a Swift distance function for maze locations or multidimensional DataPoint values.

Read how Classic Computer Science Problems in Swift: Essential techniques for practicing programmers explains Euclidean distance →

Advanced Algorithms and Data Structures

Euclidean distance is the straight-line distance between points in Euclidean space, computed from the square root of the sum of squared coordinate differences.

How it is used
Measures closeness for nearest-neighbor queries and supplies a straight-line estimate for route search.
How deep it goes
Defines straight-line distance and applies it to search decisions, without deriving multidimensional search internals here.
Examples
Uses warehouses on a straight road, price-and-rating points, spherical SS-tree nodes, and road-route estimates.
What you can do after
Apply it to compare point distances and evaluate when straight-line distance is an appropriate approximation or A* heuristic.

Read how Advanced Algorithms and Data Structures explains Euclidean distance →

Data Without Labels

Euclidean distance is the straight-line distance between points in a coordinate space, computed as the square root of the summed squared coordinate differences.

How it is used
Measures similarity for clustering observations and centroids, while serving as a common distance choice in k-means and DBSCAN.
How deep it goes
Defines straight-line distance and gives a two-coordinate formula; defers detailed L2-norm treatment and high-dimensionality discussion.
Examples
Uses two coordinate points, a visual comparison of distance metrics, and a DBSCAN nearest-neighbor-distance plot.
What you can do after
Evaluate/understand it when interpreting centroid proximity and comparing distance choices for clustering.

Read how Data Without Labels explains Euclidean distance →

Natural Language Processing in Action, Second Edition

Euclidean distance is the straight-line distance between two points or vectors computed from the square root of the sum of squared coordinate differences.

How it is used
Measures geometric separation between feature vectors in NLP and machine-learning pipelines.
How deep it goes
Defines the formula geometrically, works through vector subtraction, and stops short of detailed high-dimensional implementation.
Examples
Uses 2D term-frequency vectors, vector diagrams, and geographic latitude–longitude coordinates.
What you can do after
Apply it via vector subtraction and NumPy for low-dimensional comparisons, then evaluate cosine distance for high-dimensional vectors.

Read how Natural Language Processing in Action, Second Edition explains Euclidean distance →

Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

Euclidean distance is the straight-line distance between two points in Euclidean space.

How it is used
Uses straight-line separation to engineer geographical features for machine-learning models.
How deep it goes
Defines direct-path distance, relates it to the L2 norm, and stops short of a dense mathematical derivation.
Examples
Uses Tokyo Airbnb listings, Imperial Palace coordinates, meter conversion, and nearest-location inspection.
What you can do after
Evaluate whether straight-line or Manhattan distance better represents a geographical machine-learning feature.

Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains Euclidean distance →

Statistics Slam Dunk

Euclidean distance is the straight-line distance between points computed as the square root of the sum of squared coordinate differences.

How it is used
Measures pairwise dissimilarity before hierarchical clustering.
How deep it goes
Explains the coordinate formula, works two NBA examples, and applies R distance-matrix computation.
Examples
Uses NBA draft pick number, average win shares, R calculations, and a clustering dendrogram.
What you can do after
Apply it via base R to calculate pairwise distances and prepare hierarchical clustering.

Read how Statistics Slam Dunk explains Euclidean distance →

Optimization Algorithms: AI techniques for design, planning, and control problems

Euclidean distance is the straight-line distance between points calculated from the square root of the sum of squared coordinate differences.

How it is used
Guides spatial search, routing, numerical-data comparison, and geometric representations for optimization and machine learning.
How deep it goes
Defines the metric and demonstrates applications in A* and TSP, without developing a detailed mathematical derivation.
Examples
Uses road-network routing, point-based TSP instances, and Euclidean-distance heatmaps as concrete examples.
What you can do after
Apply it as a straight-line heuristic and inspect pairwise distances in TSP experiments.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains Euclidean distance →

MongoDB 8.0 in Action, Third Edition

Euclidean distance is the straight-line distance between two points or vectors in Euclidean space.

How it is used
Supports vector-search similarity ranking when spatial distance between embeddings is meaningful.
How deep it goes
Defines straight-line distance and connects it to HNSW navigation, but does not present a calculation formula.
Examples
Uses image recognition, clustering, embedding retrieval, and nearest-neighbor graph navigation as applications.
What you can do after
Evaluate similarity metrics for vector search and understand how distance guides approximate or exact nearest-neighbor retrieval.

Read how MongoDB 8.0 in Action, Third Edition explains Euclidean distance →

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.