How to convert a vector to a unit vector if its magnitude is smaller than one?

$\begingroup$

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$ 1

1 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like