Matrices.org

Angle Between Vectors Calculator

Find the angle between two vectors using the dot product formula. Calculate the angle in degrees, radians, or both. Enter 2D, 3D, or higher-dimensional vectors to see their dot product, magnitudes, cosine value, and a complete step-by-step solution.

Calculate the Angle Between Two Vectors

Enter the components of both vectors. They must have the same number of components, and neither vector can be the zero vector.

Example: 3, 4 or 1, 2, 3
Example: 1, 2 or 4, 5, 6

What Is the Angle Between Two Vectors?

The angle between two vectors is the smaller angle formed when the vectors are placed with their tails at the same point. In standard Euclidean geometry, this angle ranges from 0° to 180°.

The dot product provides a way to calculate this angle without needing to draw the vectors. It works for vectors in two dimensions, three dimensions, and higher-dimensional spaces.

An angle of 0° means the vectors point in the same direction. An angle of 90° means they are perpendicular. An angle of 180° means they point in opposite directions.

Angle Between Vectors Formula

The angle is calculated from the dot product and the magnitudes of the two nonzero vectors:

cos(θ) = (A · B) / (|A| × |B|)

Taking the inverse cosine gives the angle:

θ = cos⁻¹((A · B) / (|A| × |B|))

For vectors with n components:

A · B = a₁b₁ + a₂b₂ + ... + aₙbₙ
|A| = √(a₁² + a₂² + ... + aₙ²)
|B| = √(b₁² + b₂² + ... + bₙ²)

The inverse cosine, written as arccos or cos⁻¹, returns an angle between 0 and π radians, equivalent to 0° through 180°.

Example: Find the Angle Between Two 2D Vectors

Consider these vectors:

A = (3, 4),   B = (1, 2)

Step 1: Calculate the dot product

A · B = (3 × 1) + (4 × 2) = 11

Step 2: Find the magnitudes

|A| = √(3² + 4²) = 5
|B| = √(1² + 2²) = √5

Step 3: Calculate the cosine

cos(θ) = 11 / (5 × √5) ≈ 0.98387

Step 4: Calculate the angle

θ = arccos(0.98387) ≈ 10.305°

The angle between (3, 4) and (1, 2) is approximately 10.305 degrees.

Angle Between 3D Vectors

The same dot product formula works for three-dimensional vectors. For example, consider:

A = (1, 0, 0),   B = (0, 1, 0)

The dot product is:

A · B = (1 × 0) + (0 × 1) + (0 × 0) = 0

Both vectors have a magnitude of 1, so:

cos(θ) = 0 / (1 × 1) = 0
θ = arccos(0) = 90° = π/2 radians

These vectors are perpendicular. The formula also applies to vectors with four, five, or more components.

Degrees vs. Radians

Degrees and radians are two ways to measure angles. A full rotation is 360 degrees or 2π radians.

180° = π radians
Radians = Degrees × π / 180
Degrees = Radians × 180 / π

Degrees are commonly used in everyday geometry and many introductory mathematics problems. Radians are widely used in calculus, trigonometry, physics, and advanced mathematics.

Common angle conversions

Types of Angles Between Vectors

Acute angle: between 0° and 90°

An acute angle occurs when the dot product is positive. The vectors point generally in the same direction.

Right angle: exactly 90°

Perpendicular vectors have a dot product of zero. They are also called orthogonal vectors.

Obtuse angle: between 90° and 180°

An obtuse angle occurs when the dot product is negative. The vectors point generally in opposite directions.

Zero angle: 0°

The vectors point in the same direction and are positive scalar multiples of one another.

Straight angle: 180°

The vectors point in exactly opposite directions and are negative scalar multiples of one another.

Why Is the Zero Vector Not Allowed?

The angle formula divides the dot product by the product of the vector magnitudes:

cos(θ) = (A · B) / (|A| × |B|)

The zero vector has a magnitude of zero. If either vector is the zero vector, the denominator becomes zero, making the expression undefined. A zero vector has no direction, so there is no meaningful angle to calculate.

Applications of the Angle Between Vectors

Physics

The angle between force, velocity, and displacement vectors helps calculate work, power, and directional components.

Engineering

Engineers use vector angles to analyze forces, structural directions, mechanical motion, and three-dimensional geometry.

Computer Graphics

Angles between direction vectors and surface normals are important for lighting, shading, reflections, and 3D rendering.

Machine Learning

Cosine similarity compares the directions of data vectors. It is commonly used in text similarity, recommendation systems, and vector search.

Navigation and Robotics

Direction vectors help determine orientation, turning angles, and relationships between movement paths.

Frequently Asked Questions

1. How do you find the angle between two vectors?

Calculate the dot product, divide it by the product of the magnitudes, and apply the inverse cosine function: θ = arccos((A · B) / (|A||B|)).

2. What is the range of the angle between two vectors?

The standard angle between two nonzero Euclidean vectors ranges from 0° to 180°, or 0 to π radians.

3. What is the angle between perpendicular vectors?

The angle is 90 degrees or π/2 radians. Their dot product equals zero.

4. Can the angle between vectors be obtuse?

Yes. An angle greater than 90 degrees and less than 180 degrees is obtuse. The dot product is negative.

5. Can I calculate the angle between 3D vectors?

Yes. The dot product formula works in three dimensions and higher dimensions. This calculator supports 2D to 8D vectors.

6. Why is the angle with the zero vector undefined?

The zero vector has no direction and has magnitude zero. The angle formula would divide by zero.

7. What is the difference between degrees and radians?

They are different units for measuring the same angle. A half-turn is 180 degrees or π radians.

8. Can I enter fractions or negative numbers?

Yes. Enter integers, negative numbers, decimals, fractions such as 1/2, or scientific notation.

Related Calculators

Explore other vector and matrix calculators: