ID EN
Math

dist

Python 3.11

Return the Euclidean distance between two points p and q, each given as a sequence (or iterable) of coordinates. The two points must have the same dimension.

Syntax

PYTHON
math.dist(p, q)

Examples

Example 1
PYTHON
sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))