How to find the slope for a three-dimensional line?
Last Updated :
23 Jul, 2025
In three dimensions, lines don’t have a single slope like in 2D. Instead, use the direction vector, which shows the line’s direction. To find it:
- Identify two points on the line, say P(x_1, y_1, z_1) and Q(x_2, y_2, z_2).
- Calculate the direction vector: \vec{v} = (x_2 - x_1, y_2 - y_1, z_2 - z_1).
This vector describes the line’s orientation in 3D space, effectively serving as its “slope.”
Slope of a 3D Line
For a line passing through two points (x1, y1, z1) and (x2, y2, z2), the direction ratios of the line are given by:
Direction ratios = (x2 − x1, y2 − y1, z2 − z1)
These direction ratios represent the changes in x, y, and z between the two points, and they define the direction of the line which is same as slope in 2D.
If you want to express the line parametrically or in vector form, the parametric equations of the line would be:
- x = x_1 + t(x_2 - x_1)
- y = y_1 + t(y_2 - y_1)
- z = z_1 + t(z_2 - z_1)
Where t is a parameter that traces the line.
You can also define the slope between two points in terms of the angles the line makes with the coordinate axes. If α, β, and γ are the angles between the line and the x-axis, y-axis, and z-axis respectively, the direction cosines are:
l = cos(α), m = cos(β), n = cos(γ)
These values define the orientation of the line in space. The slope of the line in each plane (e.g., xyx, xz, and yz) can be found by considering the direction ratios in that particular plane.
Example of Finding Slope of a 3D Line
To find the "slope" or direction ratios of a 3D line, let's work through an example.
Example: Find the direction ratios and parametric equations of the line passing through the points (2, 3, 5) and (6, 7, 9).
Step 1: Calculate the direction ratios
The direction ratios (a, b, c) of the line are simply the differences in the coordinates of the two points.
- a = x2 - x1 = 6 - 2 = 4
- b = y2 - y1 = 7 - 3 = 4
- c = z2 - z1= 9 - 5 = 4
So, the direction ratios of the line are (4, 4, 4).
Step 2: Write the parametric equations of the line
The parametric equations of the line are given by:
- x = x_1 + t(x_2 - x_1)
- y = y_1 + t(y_2 - y_1)
- z = z_1 + t(z_2 - z_1)
Substitute the values of x1 = 2, y1 = 3, z1 = 5, and the direction ratios (4, 4, 4):
- x = 2 + 4t
- y = 3 + 4t
- z = 5 + 4t
Where t is a parameter that can take any real value, tracing the line.
Step 3: Direction cosines (optional)
If you want to find the direction cosines (the cosines of the angles the line makes with the x-axis, y-axis, and z-axis), you can calculate them using the formula:
- l = \frac{a}{\sqrt{a^2 + b^2 + c^2}},
- m = \frac{b}{\sqrt{a^2 + b^2 + c^2}}, and
- n = \frac{c}{\sqrt{a^2 + b^2 + c^2}}
In this case:
- l = \frac{4}{\sqrt{4^2 + 4^2 + 4^2}} = \frac{4}{\sqrt{48}} = \frac{4}{4\sqrt{3}} = \frac{1}{\sqrt{3}}
- m = \frac{4}{\sqrt{48}} = \frac{1}{\sqrt{3}}
- n = \frac{4}{\sqrt{48}} = \frac{1}{\sqrt{3}}
So, the direction cosines are \left( \frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}} \right).
Read More,
Explore
Basic Arithmetic
Algebra
Geometry
Trigonometry & Vector Algebra
Calculus
Probability and Statistics
Practice