I have two points in 3D:
(xa, ya, za) (xb, yb, zb)
And I want to calculate the distance:
dist = sqrt((xa-xb)^2 + (ya-yb)^2 + (
You can just subtract the vectors and then innerproduct.
Following your example,
a = numpy.array((xa, ya, za)) b = numpy.array((xb, yb, zb)) tmp = a - b sum_squared = numpy.dot(tmp.T, tmp) result = numpy.sqrt(sum_squared)