distance - chung-leong/qb GitHub Wiki

distance - Distance between two vectors

float distance( float[] $x, float[] $y )

distance() calculates the distance between vector x and y.

Parameters:

x - The first vector. It can be a one-dimensional array or a multi-dimensional array.

y - The second vector. It can be a one-dimensional array or a multi-dimensional array. The lowest dimensional--i.e. the vector width--should match that of x.

Return Value:

The distance between x and y. If either x or y is a multi-dimensional array, the return value will be an array whose size is the number of vectors in the larger of x and y.

Version

1.0 and above.