Angle Between Two Lines Explained with Worked Examples

The angle between two lines with direction vectors and satisfies , taking the acute angle.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

  • the scalar product of two vectors
  • the length of a vector from its components
  • the direction vector of a line, which is the vector that gives its direction

What Angle between two lines means

The angle between two lines is the angle between their directions. Take the scalar product of the direction vectors, divide by the product of their lengths and use the inverse cosine. The absolute value gives the acute angle between the lines.

A zero scalar product means the lines are perpendicular, just as the product of gradients is −1 for perpendicular lines in two dimensions. If the directions are multiples of each other, the lines are parallel.

The lines are given in vector form; their direction vectors are the multipliers of and .

What is it used for?

The angle between two lines tells you how sharply they cross or how nearly they are parallel. In space it is defined through the direction vectors, even when the lines do not meet.

How to use angle between two lines

  1. Read the direction vectors from the equations.
  2. Compute the scalar product and the two lengths.
  3. Find (with an absolute value for the acute angle).
  4. Take the inverse cosine.

Graph

Two lines with directions (1, 0) and (1, 1) meet at 45°meeting point45°-1012345-1012345Two lines with directions (1, 0) and (1, 1) meet at 45°xydirection (1, 0)direction (1, 1)Graph with x from -1 to 5 and y from -1 to 5. Shows the curve direction (1, 0); the curve direction (1, 1); point meeting point at (0, 0); point 45° at (1.5, 0.3).

The angle between the lines is the angle between their direction vectors, found with the scalar product.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: a diagonal and an axis

Find the angle between lines with directions and .

Worked example
Answer
45∘45^{\circ}
  1. Scalar product and lengths
  2. cos θ

Example 2: perpendicular lines

Find the angle between lines with directions and .

Worked example
Answer
90∘90^{\circ}
  1. Scalar product

Example 3: a 3-4-5 angle

Find the angle between lines with directions and .

Worked example
Answer
53.13∘53.13^{\circ}
  1. cos θ

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

Perpendicular lines

d₁ = (1, 2, 2), d₂ = (2, 1, −2): d₁·d₂ = 2 + 2 − 4 = 0

A scalar product of zero means the lines are perpendicular.

A diagonal and an axis

d₁ = (1, 1, 0), d₂ = (1, 0, 0): cos θ = 1/√2, so θ = 45°

The diagonal of the xy-plane makes 45° with the x-axis.

A 3-4-5 angle

d₁ = (3, 4, 0), d₂ = (1, 0, 0): cos θ = 3/5, so θ ≈ 53.1°

The lengths are 5 and 1, and the scalar product is 3.

An obtuse result

d₁ = (1, 0, 0), d₂ = (−1, 1, 0): d₁·d₂ = −1, so the vectors are at 135°, but the lines meet at 45°

Use the absolute value of the scalar product to get the acute angle.

Scalar products and angles
Directionsd₁·d₂Angle between the lines
(1, 0, 0) and (0, 1, 0)090°
(1, 1, 0) and (1, 0, 0)145°
(3, 4, 0) and (1, 0, 0)353.1°
(1, 2, 2) and (2, 1, −2)090°

Word problems

Find the direction vectors, work out the scalar product and the two lengths, then use cos θ = |d₁·d₂| ÷ (|d₁||d₂|). Give the acute angle.

Two lines

Line 1 has direction (1, 2, 2) and line 2 has direction (3, 0, 4). Find the acute angle between them.

  1. The scalar productd₁·d₂ = 1 × 3 + 2 × 0 + 2 × 4 = 11
  2. The lengths|d₁| = √(1 + 4 + 4) = 3 and |d₂| = √(9 + 16) = 5
  3. Use the formulacos θ = 11 ÷ 15 = 0.7333
  4. Use the inverse cosineθ = 42.8°
  5. Check: cos 42.8° ≈ 0.733 ✓The angle is 42.8°.

Are they perpendicular?

Two lines have directions (2, −1, 3) and (1, 5, 1). Are they perpendicular?

  1. Work out the scalar product2 × 1 + (−1) × 5 + 3 × 1 = 2 − 5 + 3 = 0
  2. Check: a scalar product of 0 means the directions are at 90° ✓Yes, the lines are perpendicular.

Another angle Higher

Line 1 has direction (1, 2, 2) and line 2 has direction (−2, 3, 6). Find the acute angle between them to 1 decimal place.

  1. The scalar productd₁·d₂ = −2 + 6 + 12 = 16
  2. The lengths|d₁| = 3 and |d₂| = √(4 + 9 + 36) = 7
  3. Use the formulacos θ = 16 ÷ 21 = 0.7619
  4. Use the inverse cosineθ = 40.4°
  5. Check: cos 40.4° ≈ 0.762 ✓The angle is 40.4°.

A negative scalar product Higher

Line 1 has direction (1, 0, 0) and line 2 has direction (−1, 1, 0). Find the angle between the lines.

  1. The scalar productd₁·d₂ = −1
  2. Take the absolute value and divide by the lengths 1 and √2cos θ = 1 ÷ √2
  3. Use the inverse cosineθ = 45°
  4. Check: without the absolute value the angle would be 135°, which is the angle between the vectors, not the lines ✓The acute angle between the lines is 45°.

Common mistakes

Using position vectors instead of direction vectors

using the vector to a point on the line ✗

use the direction vector, the coefficient of the parameter t ✓

The angle between lines depends only on their directions.

Forgetting the absolute value

cos θ = −1/√2, so θ = 135° ✗

cos θ = 1/√2, so θ = 45° ✓

The angle between two lines is taken as the acute angle.

Dividing by only one length

cos θ = 11 ÷ 3 = 3.67 ✗

cos θ = 11 ÷ (3 × 5) = 0.733 ✓

Divide by the product of both lengths. A cosine cannot be greater than 1.

Using sine instead of cosine

sin θ = 11 ÷ 15, so θ = 47.2° ✗

cos θ = 11 ÷ 15, so θ = 42.8° ✓

The scalar product formula uses cosine.

A scalar product slip

(1, 2, 2)·(3, 0, 4) = 3 + 0 + 4 = 7 ✗

3 + 0 + 8 = 11 ✓

Multiply the matching components, 2 × 4 = 8.

A length slip

|(1, 2, 2)| = 5 ✗

|(1, 2, 2)| = √9 = 3 ✓

Add the squares 1 + 4 + 4 = 9, then take the root.

Exam tips

  1. Write the line in vector form and pick out the direction vector.
  2. Work out three things: d₁·d₂, |d₁| and |d₂|.
  3. Take the absolute value of the scalar product for the acute angle.
  4. Use degree mode and give the angle to 1 decimal place.
  5. Check for perpendicular lines first: a zero scalar product gives 90°.
  6. The lines need not meet. The angle depends only on the directions.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. Find the angle between lines with directions (1, 0, 0) and (1, 1, 0) Foundation

cos θ = 1/√2, so θ = 45°

2. Find the angle between lines with directions (0, 3, 4) and (0, 0, 1) to 1 decimal place Foundation

cos θ = 4/5, so θ = 36.9°

3. Are the lines with directions (2, −1, 2) and (1, 2, 0) perpendicular? Foundation

The scalar product is 2 − 2 + 0 = 0, so yes

4. Find the angle between lines with directions (1, 1, 1) and (1, 0, 0) to 1 decimal place Higher

cos θ = 1/√3, so θ = 54.7°

5. Find the angle between lines with directions (2, 3, 6) and (3, 4, 12) to 1 decimal place Higher

The scalar product is 90, the lengths are 7 and 13, so cos θ = 90/91 and θ = 8.5°

6. Find the angle between lines with directions (1, 1, 0) and (0, 1, 1) Higher

The scalar product is 1 and the lengths are √2 and √2, so cos θ = 1/2 and θ = 60°

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Direction vector
A vector that points along a line.
Scalar product
d₁·d₂ = x₁x₂ + y₁y₂ + z₁z₂. See scalar product.
Magnitude
The length of a vector, √(x² + y² + z²).
Acute angle
An angle less than 90°.
Perpendicular
At a right angle, with a scalar product of 0.
Skew lines
Lines in three dimensions that are not parallel and do not meet.
Inverse cosine
The function cos⁻¹, used to turn the cosine into an angle.
Position vector
A vector to a point from the origin. It is not used for the angle.

Frequently asked questions

How do you find the angle between two lines?

Use cos θ = |d₁·d₂| ÷ (|d₁||d₂|), where d₁ and d₂ are the direction vectors.

When are two lines perpendicular?

When the scalar product of their direction vectors is zero. Compare perpendicular lines in two dimensions.

Which angle do I give?

The acute angle. The absolute value of the scalar product makes sure you get it.

Do the lines have to intersect?

No. The angle depends only on the directions, so it can be found for skew lines too.

What if the lines do not meet?

Use the same formula. The lines are skew if they are not parallel and do not meet.

How is this related to planes?

The same idea gives the angle between a line and a plane and the angle between two planes.

More in Vectors and matrices and the formula sheets.