Math Functions

math.dist()

Measure Euclidean distance between two equally dimensional coordinate iterables.

Formal Syntax & Structure

python syntaxpython
math.dist(p, q, /)

Parameters & Attributes

NameTypeDescription
piterable of numbersCoordinates of the first point.
qiterable of numbersCoordinates of the second point, with matching dimensionality.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.dist((1, 2), (4, 6)))
Python Reference