Home >>Python math Module >Python math.dist() Method
Python math.dist() Method in python is used to returns and calculates the euclidean distance between two points (x and y), where x and y are the coordinates of that point and it accepts a number.
Syntax:math.dist(p,q)
Parameter | Description |
---|---|
X | It is Required for representing the First point of Euclidean space |
Y | It is required for representing the Second point of Euclidean space |
import math
x = [3]
y = [1]
print (math.dist(x, y))
import math
x = [3, 9, 7, 2, 4, 5]
y = [-5, -3, -9, 0, 6, 2]
eDistance = math.dist(x, y)
print(eDistance)