VECTOR_NORM
VECTOR_NORM
returns the Euclidean norm of a vector as a
BINARY_DOUBLE
. This value is also called the magnitude or size and
represents the Euclidean distance between the vector and the origin. For a vector v
= (v1, v2, ..., vn)
, the Euclidean norm is given by ||v|| =
SQRT(v12 + v22 + ... + vn2)
.
Parameters
expr
must evaluate to a vector.
If expr
is NULL, NULL is returned.
Example
SELECT VECTOR_NORM( TO_VECTOR('[4, 3]', 2, FLOAT32) ); VECTOR_NORM(TO_VECTOR('[4,3]',2,FLOAT32)) ____________________________________________ 5.0