Direction cosines and direction ratios · Mathematics… | StemPy Lab
Course 15.1·Lesson 1 of 3
Direction cosines and direction ratios
A direction in space needs three numbers. The direction cosines are the cosines of the angles that a line makes with the three axes. Direction ratios are any three numbers in the same proportion. Divide them by their root of the sum of squares and you get the direction cosines.
about 25 min1 simulation1 practice question
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the distance between two points in space;
find the direction cosines and the direction ratios of a line, and of the line through two points;
use l2+m2+n2=1 to test and to find direction cosines.
Telling a drone where to fly
A flat map needs two numbers for a place: how far east and how far north. A drone also climbs, so it needs a third number, the height. We write a point as (x,y,z) and measure all three from the origin O along three axes at right angles. The Indian textbooks and A-Level and IB books use the same coordinates, so there is nothing new to learn here.
The distance between P(x1,y1,z1) and Q(x2,y2,z2) comes from Pythagoras applied twice:
PQ2=(x2−x1)2+(y2−y1)2+(z2−z1)2.
So PQ is the square root of the right-hand side.
Direction cosines
Draw a line through the origin. It makes three angles with the positive directions of the axes. Call them α, β and γ (alpha, beta and gamma). The three cosines are the direction cosines of the line:
l=cosα,m=cosβ,n=cosγ.
Take the point P(x,y,z) on the line at distance r from the origin. The coordinates are x=lr, y=mr and z=nr. Square them and add:
x2+y2+z2=r2givesl2+m2+n2=1.
This is the one rule that every set of direction cosines obeys. A line has two directions, so it has two sets of direction cosines. If (l,m,n) is one set, then (−l,−m,−n) is the other. The angles become 180∘−α and so on.
The axes themselves have direction cosines (1,0,0) for the x-axis, (0,1,0) for the y-axis and (0,0,1) for the z-axis.
A three-dimensional picture with the x, y and z axes drawn from the origin. A blue arrow runs from the origin to a point P in the first octant. Dashed grey lines drop from P to the xy-plane and to the three axes, forming a box. The three angles that the arrow makes with the x-axis, the y-axis and the z-axis are marked alpha, beta and gamma.
Direction ratios
Any three numbers a, b, c in the same proportion as l, m, n are direction ratios of the line. For example (2,3,6) and (4,6,12) and (−2,−3,−6) all describe the same line. To get the direction cosines, divide by a2+b2+c2:
l=a2+b2+c2a,m=a2+b2+c2b,n=a2+b2+c2c.
Use the same sign in all three, either + or −. The two signs give the two directions.
A-Level and IB books do not use the words "direction ratios". They say "a direction vector d=ai^+bj^+ck^". The numbers are the same. The unit vector li^+mj^+nk^ along it is the vector whose components are the direction cosines.
The line through two points
For the points P(x1,y1,z1) and Q(x2,y2,z2) the direction ratios are the differences of the coordinates:
a=x2−x1,b=y2−y1,c=z2−z1.
The direction cosines are these numbers divided by the distance PQ.
A worked example
A drone flies in a straight line from P(2,−1,3) to Q(8,1,6). The coordinates are in metres.
The direction ratios.(8−2,1−(−1),6−3)=(6,2,3).
The length.PQ=36+4+9=7 metres.
The direction cosines.l=76, m=72 and n=73.
The check.4936+494+499=1.
The angles.α=cos−176≈31.0∘, β≈73.4∘ and γ≈64.6∘.
The drone flying back from Q to P has direction cosines −76, −72 and −73.
A second example. A line makes equal angles with the three axes. Then l=m=n, so 3l2=1 and l=±31. The angle is cos−131≈54.74∘. This is the angle between a cube's body diagonal and an edge.
Practise with new numbers
Try it in Python
The program finds the direction ratios, the direction cosines and the angles for the drone of the worked example.
Common mistakes
Stopping at the ratios. Direction ratios are not direction cosines. Divide by the length.
Mixing the signs. Use one sign for all three. (76,−72,73) is a different line.
Wrong order in a subtraction. Subtract the first point from the second in every coordinate, not in some.
Taking angles from the ratios. The angle with the x-axis is cos−1l, not cos−1a.
Remember these
l=cosα, m=cosβ, n=cosγ, and l2+m2+n2=1.
A line has two sets of direction cosines, (l,m,n) and (−l,−m,−n).
Direction ratios (a,b,c) give l=a2+b2+c2a, and the same for m and n.
The line through two points has direction ratios equal to the differences of the coordinates.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Can 21, 21, 21 be the direction cosines of a line?
Write the direction cosines of the y-axis, and of the y-axis when it is traced in the opposite direction.
Find the direction cosines of the line with direction ratios (4,−4,7).
Find the direction cosines of the line through A(−1,2,5) and B(3,8,3), in the direction from A to B.
A line has l=32 and m=31. Find n.
References
OpenStax, Calculus Volume 3, Chapter 2, section on vectors in three dimensions (coordinates, distance and direction).
NCERT, Mathematics Part II for Class XII, Chapter 11, sections on direction cosines and direction ratios.
Enroll free in Lines in Space: Direction Cosines, Equations and Angles
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.