In my javascript project, I need to convert a vector to a unit vector. I know that I can divide its x and y components by its magnitude. But what if the vector's magnitude is smaller than one? How to make it a unit vector then ?
$\endgroup$ 11 Answer
$\begingroup$The same way. Divide by its magnitude. Remember that when you divide by a number that’s less than one, you’re increasing the total value.
$\endgroup$ 4