Math Functions
math.dist()
Measure Euclidean distance between two equally dimensional coordinate iterables.
Formal Syntax & Structure
python syntaxpython
math.dist(p, q, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| p | iterable of numbers | Coordinates of the first point. |
| q | iterable of numbers | Coordinates 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)))