Direction Ratios: Definition Formula and Examples

#Direction Ratios
TL;DR
Direction ratios of a line are any three numbers (a, b, c), not all zero, in the same proportion as its direction cosines. Read them off a vector's components or subtract two points; divide by a2+b2+c2\sqrt{a^2 + b^2 + c^2} to get the cosines.
Ruchi Shah·reviewed byShikha SharmaLast updated on December 2, 202615 min read

Key Points

  • For v=ai^+bj^+ck^\mathbf{v} = a\hat{\mathbf{i}} + b\hat{\mathbf{j}} + c\hat{\mathbf{k}}, one set of direction ratios is (a,b,c)(a, b, c).
  • For the line through P(x1,y1,z1)P(x_1, y_1, z_1) and Q(x2,y2,z2)Q(x_2, y_2, z_2), one set is (x2−x1, y2−y1, z2−z1)(x_2 - x_1,\ y_2 - y_1,\ z_2 - z_1).
  • A line has infinitely many sets: multiply any set by a non-zero number to get another.
  • Lines are parallel when their ratios are proportional, and perpendicular when a1a2+b1b2+c1c2=0a_1a_2 + b_1b_2 + c_1c_2 = 0.

Why Does a Line in 3D Need Three Numbers to Say Which Way It Points?

On a flat page, one number, the slope, says which way a line runs, but in space it cannot. Slope is rise over run, and a laser pointed from one corner of a room to the far ceiling leans along the length, the width and the height at once.

Direction ratios fix this with three numbers:

  • They record how far the line travels along x, y and z compared with each other.
  • A cable that goes 6 m east, 2 m north and drops 3 m has direction ratios (6,2,−3)(6, 2, -3).
  • A cable going 12 east, 4 north and dropping 6 runs the same way: only the proportion 6:2:−36 : 2 : -3 matters.
three different sets of direction ratios that all describe the same line through the origin
A line through the origin O drawn on 3D axes, with three marked points (1, 2, 2), (2, 4, 4) and (−1, −2, −2) on it. A panel shows that each point gives the same proportion 1 : 2 : 2, and that any non-zero multiple k times (1, 2, 2) names the same line.

What Is a Direction Ratio?

A set of direction ratios of a line is any three numbers aa, bb, cc, not all zero, that are proportional to the line's direction cosines. In symbols, a:b:c=l:m:na : b : c = l : m : n, where ll, mm, nn are the cosines of the angles the line makes with the positive x-, y- and z-axes.

  • Everyday version: any vector along the line gives a set. For v=4i^−3j^+2k^\mathbf{v} = 4\hat{\mathbf{i}} - 3\hat{\mathbf{j}} + 2\hat{\mathbf{k}}, the ratios are (4,−3,2)(4, -3, 2).
  • (4,−3,2)(4, -3, 2), (8,−6,4)(8, -6, 4) and (−4,3,−2)(-4, 3, -2) all describe the same line; the direction cosines are the one set scaled to length 1.
  • i^\hat{\mathbf{i}}, j^\hat{\mathbf{j}}, k^\hat{\mathbf{k}} are the unit vectors along the axes: see components of a vector and vectors.

How Do You Find the Direction Ratios of a Line?

Read them from a vector, or subtract the coordinates of two points on the line.

From a vector v=ai^+bj^+ck^\mathbf{v} = a\hat{\mathbf{i}} + b\hat{\mathbf{j}} + c\hat{\mathbf{k}}:

direction ratios=(a, b, c)\text{direction ratios} = (a,\ b,\ c)

From two points P(x1,y1,z1)P(x_1, y_1, z_1) and Q(x2,y2,z2)Q(x_2, y_2, z_2), subtract start from end:

direction ratios=(x2−x1, y2−y1, z2−z1)\text{direction ratios} = (x_2 - x_1,\ y_2 - y_1,\ z_2 - z_1)
  • Q−PQ - P is the trip from PP to QQ: a displacement (a move), with no interest in total length.
  • From P(2,1,1)P(2, 1, 1) to Q(4,5,5)Q(4, 5, 5): 2 along x, 4 along y, 4 up. Ratios (2,4,4)(2, 4, 4), or (1,2,2)(1, 2, 2).
the direction ratios of the line PQ are the differences of the coordinates of Q and P
P(2, 1, 1) and Q(4, 5, 5) on 3D axes, joined by an orange arrow, with a blue step of 2 along x, a green step of 4 along y and a purple step of 4 up making a staircase from P to Q. A panel shows Q − P = (4−2, 5−1, 5−1) = (2, 4, 4), which divides by 2 to give (1, 2, 2), and the length PQ = 6.
  • P−Q=(−2,−4,−4)P - Q = (-2, -4, -4) is fine: the same line travelled the other way.

What Is the Relationship Between Direction Ratios and Direction Cosines?

Direction cosines are the one set of direction ratios scaled to length 1. They are l=cos⁡αl = \cos\alpha, m=cos⁡βm = \cos\beta, n=cos⁡γn = \cos\gamma. Divide each ratio by a2+b2+c2\sqrt{a^2 + b^2 + c^2}:

l=aa2+b2+c2,m=ba2+b2+c2,n=ca2+b2+c2l = \frac{a}{\sqrt{a^2 + b^2 + c^2}}, \qquad m = \frac{b}{\sqrt{a^2 + b^2 + c^2}}, \qquad n = \frac{c}{\sqrt{a^2 + b^2 + c^2}}

and then, always, l2+m2+n2=1l^2 + m^2 + n^2 = 1.

  • (2,4,4)(2, 4, 4) has length 6 and (1,2,2)(1, 2, 2) has length 3, but both give the cosines (13,23,23)\left(\tfrac{1}{3}, \tfrac{2}{3}, \tfrac{2}{3}\right).
  • Scaling the ratios scales the length too, so the division cancels it. Ratios can be any multiple; cosines are unique (up to sign).
dividing any set of direction ratios by its length gives the same direction cosines
Three arrows from the origin along one line: orange (2, 4, 4) of length 6, blue (1, 2, 2) of length 3 and a short purple unit vector of length 1. A panel lists l = 2 ÷ 6 = 1/3, m = 4 ÷ 6 = 2/3, n = 4 ÷ 6 = 2/3, and l² + m² + n² = 1/9 + 4/9 + 4/9 = 1.

Why dividing by the length gives a cosine

  • Put v=(a,b,c)\mathbf{v} = (a, b, c) with its tail at OO and head at HH. Drop a perpendicular from HH to the x-axis; it lands at F(a,0,0)F(a, 0, 0).
  • Triangle OFHOFH has a right angle at FF, with OF=aOF = a and hypotenuse OH=∣v∣OH = |\mathbf{v}|.
  • So cos⁡α=OFOH=a∣v∣\cos\alpha = \dfrac{OF}{OH} = \dfrac{a}{|\mathbf{v}|}. The y- and z-axes give mm and nn the same way.
the right triangle that shows the direction cosine l equals a divided by the length of the vector
The vector v = (2, 4, 4) of length 6 from O to H, with the perpendicular from H to the x-axis landing at F, so OF = a = 2. The right triangle OFH is shaded, the right angle at F is marked and the angle α at O is shaded orange. A panel reads cos α = OF ÷ OH = a ÷ |v| = 2 ÷ 6, α ≈ 70.5°.

The angles themselves are covered on the direction cosine page.

In the tool below:

  • Press "(2, 4, 4): length 6". The last readout line divides the components by 6: (0.333,0.667,0.667)(0.333, 0.667, 0.667).
  • Drag the head until the vector is (1,2,2)(1, 2, 2): the cosines do not move.

Try It Yourself

Use the vector lab to see Direction Ratios at work: drag, change the numbers and watch what happens.

What Are the Properties of Direction Ratios?

A few properties follow straight from the word "ratio".

  • Not unique. Any non-zero multiple of (a,b,c)(a, b, c) is another set for the same line.
  • No units. Metres over metres is a pure number, so (6,2,−3)(6, 2, -3) is the same in metres or feet.
  • Never all zero. (0,0,0)(0, 0, 0) has no direction, so it cannot describe a line.
  • Signs carry the sense. Flipping all three signs gives the same line travelled the other way.

What zeros and signs tell you

  • One zero. (0,3,4)(0, 3, 4) has l=0l = 0, so α=90°\alpha = 90°: perpendicular to the x-axis.
  • Two zeros. (0,0,5)(0, 0, 5) has l=m=0l = m = 0, n=1n = 1: parallel to the z-axis.
  • Zero in the symmetric equation of a line x−x1a=y−y1b=z−z1c\dfrac{x - x_1}{a} = \dfrac{y - y_1}{b} = \dfrac{z - z_1}{c}: a 0 denominator means "that coordinate never changes".

How Direction Ratios Test Parallel and Perpendicular Lines

Parallel lines have proportional direction ratios; perpendicular lines have a1a2+b1b2+c1c2=0a_1a_2 + b_1b_2 + c_1c_2 = 0.

  • Parallel: if (a2,b2,c2)=k(a1,b1,c1)(a_2, b_2, c_2) = k(a_1, b_1, c_1), the lines point the same (or opposite) way.
  • Perpendicular: the angle θ\theta between two lines comes from the dot product:
cos⁡θ=∣a1a2+b1b2+c1c2∣a12+b12+c12 a22+b22+c22\cos\theta = \frac{|a_1a_2 + b_1b_2 + c_1c_2|}{\sqrt{a_1^2 + b_1^2 + c_1^2}\,\sqrt{a_2^2 + b_2^2 + c_2^2}}
  • The absolute value takes the acute angle, since a line has no preferred direction.
  • θ=90°\theta = 90° exactly when the top is zero, and scaling either set cannot change zero.
  • The same formula gives the angle between two lines and the angle between vectors.
proportional direction ratios mean parallel lines, and a zero sum of products means perpendicular lines
Two panels on 3D axes. Left: a blue line along (1, 2, 2) and an orange line along (3, 6, 6) running side by side, labelled same direction, never meet. Right: a green arrow (2, 2, 1) and a purple arrow (−1, 0, 2) from the origin with a right-angle mark, since 2·(−1) + 2·0 + 1·2 = 0.

Lines can also be skew: not parallel, yet never meeting. Spotting that needs a point on each line too, which is where the vector form of a line comes in.

Examples of Direction Ratios

The examples go from reading ratios off a vector to testing two lines.

Example 1

Find two sets of direction ratios for the line along v=4i^−3j^+2k^\mathbf{v} = 4\hat{\mathbf{i}} - 3\hat{\mathbf{j}} + 2\hat{\mathbf{k}}, and its direction cosines.

  1. The components give (4,−3,2)(4, -3, 2). Doubling gives (8,−6,4)(8, -6, 4).
  2. Length 29≈5.385\sqrt{29} \approx 5.385, so the cosines are (429,−329,229)≈(0.743,−0.557,0.371)\left(\tfrac{4}{\sqrt{29}}, -\tfrac{3}{\sqrt{29}}, \tfrac{2}{\sqrt{29}}\right) \approx (0.743, -0.557, 0.371).

Example 2

Find the direction cosines of a line with direction ratios (2,−1,2)(2, -1, 2).

  1. Do not divide by the biggest entry: (1,−0.5,1)(1, -0.5, 1) squares to 2.25, not 1.
  2. Divide by the length, 4+1+4=3\sqrt{4 + 1 + 4} = 3: (23,−13,23)\left(\tfrac{2}{3}, -\tfrac{1}{3}, \tfrac{2}{3}\right), or every sign flipped.
  3. Check: 49+19+49=1\tfrac{4}{9} + \tfrac{1}{9} + \tfrac{4}{9} = 1. ✓

Example 3

Find the direction ratios of the line through P(3,−2,1)P(3, -2, 1) and Q(5,4,7)Q(5, 4, 7).

  1. Q−P=(5−3, 4−(−2), 7−1)=(2,6,6)Q - P = (5 - 3,\ 4 - (-2),\ 7 - 1) = (2, 6, 6).
  2. Dividing by 2 gives the simpler set (1,3,3)(1, 3, 3). Both are correct.

Example 4

Do (1,2,2)(1, 2, 2), (3,6,6)(3, 6, 6) and (−3,−6,−6)(-3, -6, -6) describe the same line direction? Give the shared direction cosines.

  1. (3,6,6)=3×(1,2,2)(3, 6, 6) = 3 \times (1, 2, 2) and (−3,−6,−6)=−3×(1,2,2)(-3, -6, -6) = -3 \times (1, 2, 2): all proportional, so yes.
  2. Normalise (1,2,2)(1, 2, 2): length 3, cosines (13,23,23)\left(\tfrac{1}{3}, \tfrac{2}{3}, \tfrac{2}{3}\right). The negative set reads the line the other way.

Example 5

A line has direction ratios (0,3,4)(0, 3, 4). Find the angles it makes with the three axes.

  1. Length: 0+9+16=5\sqrt{0 + 9 + 16} = 5, so l=0l = 0, m=35m = \tfrac{3}{5}, n=45n = \tfrac{4}{5}.
  2. cos⁡α=0\cos\alpha = 0, so α=90°\alpha = 90°, as the zero promised.
  3. cos⁡β=0.6\cos\beta = 0.6, so β≈53.13°\beta \approx 53.13°; cos⁡γ=0.8\cos\gamma = 0.8, so γ≈36.87°\gamma \approx 36.87°.

Example 6

Are the lines with direction ratios (1,−2,3)(1, -2, 3) and (2,2,1)(2, 2, 1) perpendicular? If not, find the angle between them.

  1. a1a2+b1b2+c1c2=2−4+3=1a_1a_2 + b_1b_2 + c_1c_2 = 2 - 4 + 3 = 1, not 0, so not perpendicular.
  2. cos⁡θ=114×3≈0.0891\cos\theta = \dfrac{1}{\sqrt{14} \times 3} \approx 0.0891, so θ≈84.9°\theta \approx 84.9°.

Only 5.1°5.1° short of a right angle, which no sketch would show.

the two lines in Example 6 meet at about 84.9 degrees, so they are not perpendicular
A blue arrow (1, −2, 3) and a green arrow (2, 2, 1) from the origin with the angle between them shaded and labelled 84.9 degrees. A panel shows a₁a₂ + b₁b₂ + c₁c₂ = 2 − 4 + 3 = 1, cos θ = 1 ÷ (√14 × 3) ≈ 0.0891, θ ≈ 84.9°, not 90°.

What Are the Most Common Mistakes With Direction Ratios?

All three forget that only the proportion matters, or rush the arithmetic.

Mistake 1: Treating direction ratios as unique

Where it slips in: You get (2,6,6)(2, 6, 6), the answer key says (1,3,3)(1, 3, 3), and you think one is wrong.

Don't do this: "Correct" your answer, or mark the key wrong.

The correct way: Check for a multiple: (2,6,6)=2×(1,3,3)(2, 6, 6) = 2 \times (1, 3, 3), so both are right.

Mistake 2: Dividing by the wrong number to get direction cosines

Where it slips in: Converting in a hurry, dividing by the biggest entry or by a+b+ca + b + c.

Don't do this: Write l=22−1+2l = \dfrac{2}{2 - 1 + 2} for the ratios (2,−1,2)(2, -1, 2).

The correct way: Divide by a2+b2+c2\sqrt{a^2 + b^2 + c^2}, then confirm l2+m2+n2=1l^2 + m^2 + n^2 = 1.

Mistake 3: Mixing the subtraction order between coordinates

Where it slips in: Finding ratios from two points, one coordinate at a time.

Don't do this: Compute x2−x1x_2 - x_1 for the first slot and y1−y2y_1 - y_2 for the second.

The correct way: Use end minus start in all three slots; a half-reversed triple is a different line.

Where Are Direction Ratios Used?

Anywhere a direction in space is stored, compared or turned into an angle.

  • Cables and braces. A zip line from a tower top P(0,0,8)P(0, 0, 8) to an anchor Q(12,4,2)Q(12, 4, 2), in metres, has ratios Q−P=(12,4,−6)Q - P = (12, 4, -6), or (6,2,−3)(6, 2, -3).
  • It is 144+16+36=14\sqrt{144 + 16 + 36} = 14 m long, with cosines (67,27,−37)\left(\tfrac{6}{7}, \tfrac{2}{7}, -\tfrac{3}{7}\right). It drops at an angle whose sine is 614\tfrac{6}{14}: about 25.4°25.4°.
  • Lines and planes. A line is fixed by a point and direction ratios; a plane by a point and its normal's ratios (see the equation of a plane).
  • Computer graphics. A ray from a camera through a pixel stores "pixel minus camera", a set of direction ratios.
the direction ratios of a zip line come from subtracting the tower top from the anchor point
A flat-style 3D scene with a tower whose top is P(0, 0, 8) and a ground anchor post at Q(12, 4, 2), joined by an orange cable labelled 14 m, with a dashed blue line marking 12 m along x on the green ground grid. A panel reads Q − P = (12, 4, −6), simplest ratios (6, 2, −3), length √196 = 14, cosines (6/7, 2/7, −3/7), drops 25.4° below level.

Conclusion

  • Direction ratios are any three numbers, not all zero, in proportion to the direction cosines.
  • Find them from a vector's components, or by end minus start between two points.
  • Divide by a2+b2+c2\sqrt{a^2 + b^2 + c^2} to get direction cosines, and check their squares add to 1.
  • Proportional ratios mean parallel lines; a1a2+b1b2+c1c2=0a_1a_2 + b_1b_2 + c_1c_2 = 0 means perpendicular lines.

A Practical Next Step

Work these on paper, then check each against the properties above.

  1. Give two sets of direction ratios for −i^+5j^−2k^-\hat{\mathbf{i}} + 5\hat{\mathbf{j}} - 2\hat{\mathbf{k}}.
  2. Turn the ratios (6,2,3)(6, 2, 3) into direction cosines and check that the squares add to 1.
  3. Decide whether the lines with ratios (2,−1,2)(2, -1, 2) and (1,2,0)(1, 2, 0) are perpendicular.

Answer to Question 1: (−1,5,−2)(-1, 5, -2) from the components, and any multiple such as (1,−5,2)(1, -5, 2).

Answer to Question 2: the length is 36+4+9=7\sqrt{36 + 4 + 9} = 7, so the cosines are (67,27,37)\left(\tfrac{6}{7}, \tfrac{2}{7}, \tfrac{3}{7}\right), and 36+4+949=1\tfrac{36 + 4 + 9}{49} = 1.

Answer to Question 3: yes, because (2)(1)+(−1)(2)+(2)(0)=0(2)(1) + (-1)(2) + (2)(0) = 0.

To take direction ratios further with a teacher, explore Bhanzu's geometry tutor, a high school math tutor or math classes online.

Want a live Bhanzu trainer to walk your child through vectors and 3D geometry? Book a free demo class, online globally, or in person at our McKinney, TX center.

Read More

Research Behind This Article

  1. OpenStax, Calculus Volume 3, Section 2.3: The Dot Product (direction angles, direction cosines and the identity cos²α + cos²β + cos²γ = 1). openstax.org
  2. OpenStax, Calculus Volume 3, Section 2.5: Equations of Lines and Planes in Space (direction vectors, parametric and symmetric equations, parallel and skew lines). openstax.org
  3. OpenStax, Calculus Volume 3, Section 2.2: Vectors in Three Dimensions (components, length and unit vectors in 3D). openstax.org
  4. OpenStax, University Physics Volume 1, Section 2.2: Coordinate Systems and Components of a Vector (resolving a vector along axes). openstax.org
  5. Euclid, Elements, Book I, Proposition 47 (the Pythagorean theorem, behind the length a2+b2+c2\sqrt{a^2 + b^2 + c^2}), D. E. Joyce, Clark University. mathcs.clarku.edu

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

Can direction ratios be negative?
Yes. A negative ratio means the line heads towards the negative end of that axis, like (6,2,−3)(6, 2, -3).
How many sets of direction ratios does one line have?
Infinitely many. Multiply any set by a non-zero number and you get another, because only the proportion carries the direction.
Do direction ratios have units?
No. They compare distances along the axes, so the units cancel. A 14 m cable and a 7 m cable pointing the same way share direction ratios.
✍️ Written By
Ruchi Shah
Ruchi Shah
Subject Matter Expert
Ruchi Shah is a mathematics educator and curriculum designer with over 12 years of experience. She joined Bhanzu in 2022 as a full-time Mathematics Trainer, teaching live classes and working with students and parents. She has since moved into curriculum design where she builds curricula, academic planners and learning pathways for different grade levels.
LinkedIn
🔬 Reviewed By
Shikha Sharma
Subject Matter Expert
Book a FREE Demo ClassBook Now →