The angle between two lines · Mathematics Class 11–12 | StemPy Lab
Course 15.1·Lesson 3 of 3
The angle between two lines
The angle between two lines is the angle between their directions. In terms of direction ratios, cosθ=a12+b12+c12a22+b22+c22∣a1a2+b1b2+c1c2∣
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the angle between two lines from their direction ratios or direction vectors;
test whether two lines are parallel or perpendicular;
find the angle that a line makes with an axis.
Two lines, one angle
Two cables cross over a street. They may never touch, but we can still ask how far one is turned from the other. Imagine sliding both lines, without turning them, until they pass through the origin. The angle between these two new lines is the angle between the original lines. This works even for lines that do not meet.
Two lines make two angles, θ and 180∘−θ. By convention we take the acute angle (or 90∘). A-Level and IB use the same convention for the angle between two lines.
A three-dimensional picture with two straight skew lines in blue and red that do not meet. Through the origin two dashed lines of the same colours are drawn parallel to them. The angle theta between the two dashed lines is marked at the origin with an arc.
The formula
Let the direction ratios be (a1,b1,c1) and (a2,b2,c2). In vector form these are the vectors b1 and b2. The dot product of the vectors gives
With direction cosines the lengths are 1, so cosθ=∣l1l2+m1m2+n1n2∣. The modulus bars matter. Without them the formula gives the angle between the two direction vectors, which can be obtuse.
The cross product gives the sine in the same way: sinθ=∣b1∣∣b2∣∣b1×b2∣. Some books use tanθ to avoid taking a square root.
Parallel and perpendicular lines
Perpendicular:θ=90∘, so a1a2+b1b2+c1c2=0.
Parallel:θ=0∘, so a2a1=b2b1=c2c1. Equivalently b1×b2=0.
Notice that "perpendicular" here does not mean that the lines meet. Two skew lines can be perpendicular too. The next course studies such lines.
The angle with an axis
The x-axis has direction ratios (1,0,0). The line with direction ratios (a,b,c) makes the angle α with it, where cosα=a2+b2+c2∣a∣. This is the modulus of a direction cosine, which is why the direction cosines are named after the angles with the axes.
A worked example
Find the angle between the lines with direction ratios (1,2,2) and (2,3,6).
The dot product.1×2+2×3+2×6=20.
The lengths.1+4+4=3 and 4+9+36=7.
The cosine.cosθ=2120.
The angle.θ=cos−12120≈17.75∘.
More cases. The lines (1,2,2) and (2,1,−2) have dot product 2+2−4=0, so they are perpendicular. The lines (1,2,2) and (−2,−4,−4) are parallel, because the second is −2 times the first. The angle between (2,3,6) and the z-axis has cosθ=76, which is about 31.0∘.
An angle between lines given in vector form. For r=i^+λ(i^+j^) and r=2k^+μ(j^+k^), the directions are i^+j^ and j^+k^. The dot product is 1 and each length is 2, so cosθ=21 and θ=60∘.
Practise with new numbers
Try it in Python
The program finds the dot product, the cosine and the acute angle for the worked example. It then tests for perpendicular and parallel lines.
Common mistakes
Dropping the modulus. A negative dot product gives an obtuse angle. The angle between two lines is the acute one.
Using the points instead of the directions. The angle depends only on the direction ratios.
Forgetting a root. Both lengths are square roots of a sum of three squares.
Reading a Cartesian line wrongly. The direction ratios are the denominators, and not the numerators.