Unit Vector Calculator

Calculate the unit vector, magnitude, and direction angles for any 2D or 3D vector.

Enter Vector Components

Result

Unit Vector
--
direction of v
Original Vector v--
Magnitude |v|--
Unit Vector Components--
Direction Angle--

Step-by-Step Solution

u = v / |v|

What is a Unit Vector?

A unit vector is a vector with a magnitude (length) of exactly 1. It points in the same direction as the original vector but has been normalized to unit length. Unit vectors are denoted with a hat symbol, such as v-hat. They are fundamental in physics, engineering, and computer graphics for representing direction without magnitude.

How to Find the Unit Vector

To find the unit vector, divide each component of the original vector by its magnitude.

2D Unit Vector

For vector v = (x, y), first find the magnitude.

|v| = sqrt(x^2 + y^2)

3D Unit Vector

For vector v = (x, y, z), extend the formula to three dimensions.

|v| = sqrt(x^2 + y^2 + z^2)

Normalization

Divide each component by the magnitude to get the unit vector.

u = (x/|v|, y/|v|, z/|v|)

Direction Cosines

The components of a unit vector are the cosines of the angles with each axis.

cos(alpha) = x/|v|, cos(beta) = y/|v|

Standard Unit Vectors

In 2D, the standard unit vectors are i = (1, 0) and j = (0, 1). In 3D, we add k = (0, 0, 1). Any vector can be expressed as a linear combination of these standard unit vectors: v = xi + yj + zk.

Applications of Unit Vectors

  • Physics: Representing direction of forces, velocity, and acceleration.
  • Computer Graphics: Surface normals, lighting calculations, and camera direction.
  • Navigation: Heading direction for aircraft and ships.
  • Machine Learning: Normalizing feature vectors for consistent scaling.

Important Properties

  • The magnitude of any unit vector is always 1.
  • A zero vector (0, 0, 0) has no unit vector (direction is undefined).
  • The sum of squares of direction cosines equals 1: cos^2(alpha) + cos^2(beta) + cos^2(gamma) = 1.