Make your own function in javascript. It must take one parameter witch have x and y components and return a number - the length of the vector.
It can be a js function like:
function dist(a) {
return Math.sqrt(a.x * a.x + a.y * a.y);
}
or just an expression like :
sqrt(x * x + y * y)
*Note that this code will be added as a script to the page