completed distance forumla for vectors