; docformat = 'rst' ;+ ;This function takes in a vector and returns its length. The vector must be ;3-Dimensional. ; ; :Examples: ; vector_length = vlength(vector) ;- ;+ ; :Params: ; v : in, required, type=vector of int or vector of double ; Input vector that must be 3-dimensional. ; ; :Returns: ; Returns the length of the input vector. ;- function vlength,v if n_elements(v) eq 0 then begin doc_library, 'vlength' return, -1 endif resolve_grid,v,x=x,y=y,z=z lensq=x^2+y^2+z^2; len=sqrt(lensq); return,len; end