Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Vector distance functions

COSINE_DISTANCE() or EUCLIDEAN_DISTANCE() measure the difference between two vectors.

Syntax

[COSINE | EUCLIDEAN]_DISTANCE (<vector1>, <vector2>)

Arguments

COSINE and EUCLIDEAN distance is identical for unit-length vectors.

Argument Description
COSINE_DISTANCE A measure of the angle between <vector1> and <vector2> to return a measure of similarity between the values while ignoring their magnitude
EUCLIDEAN_DISTANCE The distance metric most commonly used when referring to distances between points on a plain. The resulting value is calculated as: \sqrt{\left( ^{2} + ^{2}\right)}
<vector1>, <vector2> Vector literal or Vector expressions with the same number of dimensions to compare.

Additional information

Value assignment

Data type Literal Assignment Additional information
Vector {<decimal-value>,...}    

Examples