Step by step
The question
Question: find the unit vector in the direction of (−1, 4, 8).
v = [−1; 4; 8]
A unit vector has length 1.
To get one in the same direction, we divide v by its length.
unit vector: length 1, same direction
u = v ÷ ‖v‖
1 Find the length
The length: every entry squared, added, then the square root.
‖v‖ = √(−1)2 + 42 + 82
‖v‖ = √1 + 16 + 64
‖v‖ = √81
81 is 9 squared.
So the length is 9.
‖v‖ = 9
2 Divide every entry
Every entry divided by 9.
u = [−1 over 9; 4 over 9; 8 over 9]
Careful!
Every entry is divided by the length, not only the first one.
Careful: divide EVERY entry by the length
3 Check
Let's check: the length of u must be 1.
Its entries squared add up to 1, and the root of 1 is 1.
So the answer is right!
(−19)2 + (49)2 + (89)2 = 181 + 1681 + 6481
= 8181 = 1
Let's look back.
First: find the length.
Then: divide every entry.
Last: check.
Answer
Careful: divide EVERY entry by the length