Get a vector x units from another vector

The other answers were close but I figured out how to accomplish what I was after with the following function