Unit Vectors (Normalization)
Dividing a vector by its length gives a vector of length 1 in the same direction.
e = a ÷ |a|
A zero vector has no direction, so it cannot be normalized.
Multiply a unit vector by a speed to move that fast in that direction.
Calculator
Change a value and the result and picture update instantly.
Result
Length |a|
Unit x
Unit y
Animated picture
The picture follows your values. Some points and shapes can be dragged.
Use in game development
Normalize the input direction before multiplying by speed, so diagonal movement is not faster.
Code example (JavaScript)
const len = Math.hypot(dx, dy);
if (len > 0) { dx /= len; dy /= len; } // then multiply by speed
What the symbols mean
| Symbol | Meaning |
|---|---|
x | x |
y | y |
len | Length |a| |
ux | Unit x |
uy | Unit y |
More formulas in this category
- Vector Addition and Length
- Dot Product and the Angle Between Vectors
- Cross Product (2D)
- Matrix–Vector Multiplication and Determinant
- Rotation Matrix
Frequently asked questions
- What is the formula for Unit Vectors (Normalization)?
- The formula for Unit Vectors (Normalization) is e = a ÷ |a|. Dividing a vector by its length gives a vector of length 1 in the same direction.
Math Formula Quiz Vectors & Matrices
Sources
Checked: 2026-11-29