len := proc(vec) sqrt(innerprod(vec,vec)); end; len([1,1,1]); len([x,y,z]); a := vector(3): p := vector(3): v := vector(3): dist := len( crossprod(p-a,v) ) / len(v); a := vector([0,0,0]): p:=vector([0,1,0]): v:=vector([1,0,0]): dist; d2line := proc(p,a,v) local lc,lv; lv := sqrt(innerprod(v,v)); lc := crossprod(p-a,v); lc := sqrt(innerprod(lc,lc)); lc/lv; end; d2line(p,a,v); d2line([-1,1,1],[0,0,0],v);