The manual has an example:

distance = vec_length(my.x); // calculate the distance of the my entity to the level origin

So you need to save the magnitude of those vectores in a variable for example.
Also, if you want to have always a positive value to evaluate, take a look at abs() command which returns an absolute value.