How to convert a vector to a unit vector if it's magnitude is smaller than one?
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
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 ?
vector-spaces
add a comment |Â
up vote
-1
down vote
favorite
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 ?
vector-spaces
1
"it's" (abbreviation of "it is") should be $to$ "its"
â Jean Marie
Aug 12 '16 at 19:57
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
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 ?
vector-spaces
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 ?
vector-spaces
edited Aug 27 at 16:48
Bungo
13.2k22044
13.2k22044
asked Aug 12 '16 at 19:10
arandomguy
14617
14617
1
"it's" (abbreviation of "it is") should be $to$ "its"
â Jean Marie
Aug 12 '16 at 19:57
add a comment |Â
1
"it's" (abbreviation of "it is") should be $to$ "its"
â Jean Marie
Aug 12 '16 at 19:57
1
1
"it's" (abbreviation of "it is") should be $to$ "its"
â Jean Marie
Aug 12 '16 at 19:57
"it's" (abbreviation of "it is") should be $to$ "its"
â Jean Marie
Aug 12 '16 at 19:57
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
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.
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
2
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
1
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
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.
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
2
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
1
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
add a comment |Â
up vote
4
down vote
accepted
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.
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
2
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
1
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
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.
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.
answered Aug 12 '16 at 19:12
amd
26.6k21046
26.6k21046
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
2
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
1
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
add a comment |Â
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
2
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
1
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
Oh I understand. Thanks.
â arandomguy
Aug 12 '16 at 19:14
2
2
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
Minor quibble: you need to make sure the magnitude is nonzero.
â Barry Cipra
Aug 12 '16 at 19:15
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
@BarryCipra yes.
â arandomguy
Aug 12 '16 at 19:16
1
1
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
@BarryCipra True, but one always has to check for that. That wasnâÂÂt the gist of the question.
â amd
Aug 12 '16 at 19:21
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1890478%2fhow-to-convert-a-vector-to-a-unit-vector-if-its-magnitude-is-smaller-than-one%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
"it's" (abbreviation of "it is") should be $to$ "its"
â Jean Marie
Aug 12 '16 at 19:57