- Categories:
VECTOR_L1_DISTANCE¶
Computes the L1 distance between two vectors.
L1 distance, also known as the Taxicab or Manhattan distance, is a measure of the distance between two points in a vector space. The distance is calculated by taking the sum of the absolute value of the differences of vector elements. The result is a value of zero or higher. If the distance is zero, the vectors are identical. The larger the distance, the farther apart the vectors are.
Syntax¶
Arguments¶
vectorThe VECTOR value to calculate the distance from.
vectorThe VECTOR value to calculate the distance to.
Returns¶
Returns the L1 distance between the two input vectors as a FLOAT value.
Usage notes¶
Vector functions are optimized in a way that can reduce floating point precision. This function’s results have a margin of error up to
1e-4.
Examples¶
This example uses the VECTOR_L1_DISTANCE function to determine which vectors in
the table are closest to each other between columns a and b: