Open In App

Equation of a Line | Definition, Different Forms and Examples

Last Updated : 23 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The equation of a line in a plane is given as y = mx + C, where x and y are the coordinates of the plane, m is the slope of the line, and C is the intercept. However, the construction of a line is not limited to a plane only.

We know that a line is a path between two points. These two points can be located anywhere whether they could be in a single plane or they could be in space. In the case of a plane, the location of the line is characterized by two coordinates arranged in an ordered pair given as (x, y) whereas in the case of space, the location of the point is characterized by three coordinates expressed as (x, y, z).

In this article, we will learn the different forms of equations of lines in 3D space.

What is the Equation of the Line?

The equation of a line is an algebraic way to express a line in terms of the coordinates of the points it joins. The equation of a line will always be a linear equation.

If we try to plot the points obtained from a linear equation, it will be a straight line. The standard equation of a line is given as:

ax + by + c = 0

where,

  • a and b are Coefficients of x and y
  • c is Constant Term

Different Forms of Equation of Line

In Cartesian coordinates, the equation of a line can be expressed in several different forms, depending on the context and the information available. Here are the primary Cartesian forms:

1. Slope-Intercept Form

This is one of the most common forms, especially in algebra and calculus: y = mx + b

  • m is the slope of the line, indicating its steepness.
  • b is the y-intercept, the point where the line crosses the y-axis.

Example: A line with slope 2 and y-intercept 3:

Solution:

Slope m = 2
Y-intercept c = 3
y = mx + b
y = 2x + 3

2. Point-Slope Form

This form is useful when you know a specific point on the line and the slope: y -y1 = m(x - x1)

  • (x1, y1) is a known point on the line.
  • m is the slope of the line.

Point-Slope Form is ideal when you have a specific point and the slope.

Example: Find the equation of a line passing through point (4, 2) with slope 3.

Solution:

Point: x1 = 4, y1 = 2
Slope m = 3
y -y1 = m(x - x1)
y -2 = 3(x - 4)
y -2 = 3x - 12
y = 3x - 10

3.Two-Point Form

The two-point form of a line equation uses the coordinates of two known points that the line passes through:

y -y1 = (y2 - y1)/(x2 - x1) x - x1

  • (x1 , y1) and (x2 , y2) are two distinct points on the line.
  • The slope is calculated as (y2 - y1)/(x2 - x1).

Example:Line through points (1, 2) and (3, 6):

Solution:

Point: x1 = 1, y1 = 2, x2 = 3, y2 = 6
Slope m = 3
y -y1 = (y2 - y1)/(x2 - x1) x - x1
y -2 = (6 - 2)/(3 - 1) x - 1
y -2 = 2(x - 1)
y = 2x

4. General Form (Standard Form)

The general form of a line’s equation can be written as: Ax + By + C = 0

  • A, B, and C are constants.
  • This form is often used for its simplicity and is suitable for various algebraic manipulations.

Example: Convert y = 2/3x + 2 into general form.

Solution:

y = 2/3x + 2
3y = 2x + 6
2x + 3y + 6 = 0

5. Intercept Form

This form is used when you know the x- and y-intercepts: (x/a) + (y/b) = 1

  • A is the x-intercept (the point where the line crosses the x-axis).
  • b is the y-intercept (the point where the line crosses the y-axis).

Intercept Form is helpful when the intercepts on the axes are known.

Example: Line cuts x-axis at 4 and y-axis at 2.

Solution:

a = 4, b = 2
(x/a) + (y/b) = 1
(x/4) + (y/2) = 1

6. Normal Form

The normal form of a line equation involves the normal vector and the distance from the origin: x cos θ + y sin θ = p

  • θ is the angle between the x-axis and the normal to the line.
  • p is the perpendicular distance from the origin to the line.

Example:Distance from origin p = 5, angle α = 60°

Solution:

cos 60° = 1/2
sin 60° = √3/2
x cos θ + y sin θ = 5
x 1/2 + y √3/2 = 5
x + y √3 = 10

Normal Form relates to the line’s orientation and its distance from the origin.

Forms of Equation of Line

Equation NameEquationDescription
Point-Slope Form(y - y1) = m(x - x1)Represents a line using the slope (m) and a point on the line (x1, y1).
Slope-Intercept Formy = mx + bRepresents a line using the slope (m) and the y-intercept (b).

General Form

ax + by + c = 0

Represents a line using one point(x, y) and some constants ( a, b, c )

Intercept Formx/a + y/b = 1Represents a line where it intersects the x-axis at (a, 0) and the y-axis at (0, b).
Normal Formx cos θ + y sin θ = pRepresents a line using the angle (θ) the line makes with the positive x-axis and the perpendicular distance (p) from the origin to the line.

Equation of Line in 3D

The equation of straight line in 3D requires two points which are located in space. The location of each point is given using three coordinates expressed as (x, y, z).

The 3D equation of line is given in two formats: cartesian form and vector form. In this article, we will learn the equation of a line in 3D in both Cartesian and Vector Form and also learn to derive the equation. The different cases for the equation of a line are listed below:

  • Cartesian Form of Line
    • Line Passing through two points
    • Line Passing through a given point and Parallel to a given Vector
  • Vector Form of line
    • Line Passing through two points
    • Line Passing through a given point and Parallel to a given Vector

Cartesian Form of Equation of Line in 3D

The cartesian form of line is given by using the coordinates of two points located in space from which the line is passing. In this we will discuss two cases, when line passes through two points and when line passes through points and is parallel to a vector.

Case 1: 3D Equation of Line in Cartesian Form Passing Through Two Points

Let us assume we have two points, A and B, whose coordinates are given as A(x1, y1, z1) and B(x2, y2, z2).

3D equation of line in cartesian form passing through two points

Then the 3D equation of a straight line in cartesian form is given as

file
3D Equation of a Straight line in Cartesian Form

where x, y, and z are rectangular coordinates.

Derivation of Equation of Line Passing Through Two Points

We can derive the Cartesian form of the 3D Equation of a Straight Line by the use of the following mentioned steps:

  • Step 1: Find the DRs (Direction Ratios) by taking the difference of the corresponding position coordinates of the two given points. l = (x2 - x1), m = (y2 - y1), n = (z2 - z1); Here l, m, n are the DR's.
  • Step 2: Choose either of the two given points say, we choose(x1, y1, z1).
  • Step 3: Write the required equation of the straight line passing through the points(x1, y1, z1) and (x2, y2, z2).
  • Step 4: The 3D equation of straight line in cartesian form is given as L : (x - x1)/l = (y - y1)/m = (z - z1)/n = (x - x1)/(x2 - x1) = (y - y1)/(y2 - y1) = (z - z1)/(z2 - z1)

Where (x, y, z) are the position coordinates of any variable point lying on the straight line.

Example: If a straight line is passing through the two fixed points in the 3-dimensional space whose position coordinates are P (2, 3, 5) and Q (4, 6, 12), then its cartesian equation using the two-point form is given by

Solution:

l = (4 - 2), m = (6 - 3), n = (12 - 5)
l = 2, m = 3, n = 7
Choosing the point P (2, 3, 5)

The required equation of the line
L: (x - 2) / 2 = (y - 3) /  3 = (z - 5) / 7

Case 2: 3D Equation of Line in Cartesian Passing through a Point and Parallel to a Given Vector

Let us assume the line passes through a point P(x1, y1, z1) and is parallel to a vector given as. n = a hat(I) + b hat(j) + c hat(k).

3d equation of line in cartesian passing through a point and parallel to a given vector

Then the equation of a line is given as

file
Equation of a Line

where x, y, and z are rectangular coordinates and a, b, and c are direction cosines.

Derivation of 3D Equation of Line in Cartesian Passing through a Point and Parallel to a given Vector

Let us assume we have a point P whose position vector is given as vector (P) from the origin. Let the line that passes through P is parallel to another vector (n). Let us take a point R on the line that passes through P, then the position vector of R is given as vector (n) .

file
Equation of Line in Cartesian Passing through a Point and Parallel

Now if we move on the line PR then the coordinate of any point that lies on the line will have the coordinate in the form of (x1 + λa), (y1 + λb), (z1 + λc), where λ is a parameter whose value ranges from -∞ to +∞ depending on the direction from P where we move.

Hence, the coordinates of the new point will be

  • x = x1 + λa ⇒ λ = x - x1/a
  • y = y1 + λb ⇒ λ = y - y1/b
  • z = z1 + λc ⇒ λ = z - z1/c

Comparing the above three equations, we have the equation of line as

file
New equation of line

Example: Find the equation of the line passing through a point (2, 1, 3) and parallel to a vector 3i - 2j + k

Solution:

The Equation of line passing through a point and parallel to a vector is given as

(x - x1)/a = (y - y1)/b = (z - z1)/c

From the question we have, x1 = 2, y1 = 1, z1 = 3 and a = 3, b = -2 and c = k. Hence, the required equation of the line will be

⇒ (x - 2)/3 = (y - 1 )/-2 = (z - 3)/1

Vector Form of Equation of Line in 3D

Vector Equation of a Line in 3D is given using a vector equation that involves the position vector of the points. In this heading, we will obtain the 3D Equation of the line in vector form for two cases.

Case 1: 3D Equation of Line Passing through Two Points in Vector Form

Let us assume we have two points A and B whose position vector is given as vector(a) and vector(b).

3d equation of line passing through two points in vector form

Then the vector equation of the Line L is given as

vector(l) = vector(a) + λ[vector(b) -vector(a)]
where (\vec b - \vec a) is the distance between two points and λ is the parameter that lieson the line.

Derivation of 3D Equation of Line Passing through Two Points in Vector Form

Suppose we have two points A and B whose position vector is given as vector(a) and vector(b). Now we know that a line is the distance between any two points. Hence, we need to subtract the two position vectors to obtain the distance.
⇒vector(d) = vector(b) - vector(a)

Now we know that any point on this line will be given as the sum of position vector vector(a) or vector(b) with the product of the parameter λ and the position vector of the distance between two points i.e vector(d).

Hence, the equation of the line in the vector form will be vector(l) = vector(a) + λ [vector(b) -vector(a)] or vector(l) = vector(b) + λ [vector(a) -vector(b)]

Example: Find the vector equation of a line in 3D that passes through two points whose position vectors are given as 2i + j - k and 3i + 4j + k

Solution:

Given that the two position vectors are given as 2i + j - k and 3i + 4j + k

Distance d = (3i + 4j + k) - (2i + j -k) = i + 3j + 2k

We know that equation of the line is given as vector(l) = vector(a) + λ [vector(b) -vector(a)]

Hence, the equation of the line will be \vec l = 2i + j - k + λ(i + 3j + 2k)

Case 2: Vector Form of 3D Equation of Line Passing through a Point and Parallel to a Vector

Let's say we have a point P whose position vector is given as . Let this line be parallel to another line whose position vector is given as vector(d).

vector form of 3d equation of line passing through a point and parallel to a vector

Then the vector equation of the line 'l' is given as

vector(l) = vector(p) + λ vector(d)

where λ is the parameter that lies on the line.

Derivation of the Vector Form of 3D Equation of Line Passing through a Point and Parallel to a Vector

Consider a point P whose position vector is given as vector(p) Now l, et us assume this line is parallel to a vector(d); then, the equation of the line will be vector(l) = λ vector(d) . Now, since the line also passes through point P, then as we move away from Point P in either direction on the line, the position vector of the point will be in the form of vector(p) +λ vector(d). Hence, the equation of the line will be vector(l) = vector(p) + λ vector(d), where λ is the parameter that lies on the line.

Example: Find the Vector Form of the Equation of the line passing through the point (-1, 3, 2) and parallel to a vector 5i + 7j - 3k.

Solution:

We know that the vector form of the equation of line passing through a point and parallel to a vector is given as vector(l) = vector(p) + λ vector(d).

Given that the point is (-1, 3, 2), hence the position vector of the point will be -i + 3j + 2k and the given vector is 5i + 7j - 3k.

Therefore, the required equation of the line will be \vec l = (-i + 3j + 2k) + λ(5i + 7j - 3k).

3D Lines Formulas

NameFormulaDescription
Vector Formr = a + λ dRepresents a line through point (a) parallel to direction vector (d). λ is the parameter.
Parametric Formx = x₀ + λ a, y = y₀ + λ b, z = z₀ + λ cDescribes a line using parameter (λ or t) for varying positions. (x₀, y₀, z₀) is a point on the line, and (a, b, c) is the direction vector.
Shortest Distance Between Skew Lines(Formula varies depending on specific approach)Calculates the perpendicular distance between two non-intersecting lines.
Equation of a Line Through Two Pointsx = x₀ + t a, y = y₀ + t b, z = z₀ + t cRepresents a line connecting points ((x₀, y₀, z₀)) and ((x, y, z)). t is the parameter, and (a, b, c) is the direction vector.

Similar Reads:

Solved Examples on Equation of Line in 3D

Practice equations of lines in 3D with these solved practice questions.

Example 1:If a straight line is passing through the two fixed points in the 3-dimensional whose position vectors are (2 i + 3 j + 5 k) and (4 i + 6 j + 12 k) then its Vector equation using the two-point form is given by

Solution:

vector(l) = vector(a) + λ[vector(b) -vector(a)]

vector(p) = (4 i + 6 j + 12 k) - (2 i + 3 j + 5 k)
vector(p) = (2 i + 3 j + 7 k) ; Here vector(p)  is a vector parallel to the straight line

Choosing the position vector (2 i + 3 j + 5 k)

The required equation of the straight line

L :vector(r) = (2 i + 3 j + 5 k) + t . (2 i + 3 j + 7 k)

Example 2: If a straight line is passing through the two fixed points in the 3-dimensional space whose position coordinates are (3, 4, -7) and (1, -1, 6) then its vector equation using the two-point form is given by

Solution:

Position vectors of the given points will be (3 i + 4 j - 7 k) and (i - j + 6 k)

vector(l) = vector(a) + λ[vector(b) -vector(a)]

vector(p) = (i - j + 6 k) - (3 i + 4 j - 7 k)

vector(p) = (-2 i - 5 j + 13 k) ; Here vector(p) is a vector parallel to the straight line

Choosing the position vector (3 i + 4 j - 7 k)

The required equation of the straight line

L : vector(r)  = (3 i + 4 j - 7 k) + t . (2 i + 5 j - 13 k)

Example 3:If a straight line is passing through the two fixed points in the 3-dimensional whose position vectors are (5 i + 3 j + 7 k) and (2 i +  j - 3 k) then its Vector equation using the two-point form is given by

Solution:

vector(l) = vector(a) + λ[vector(b) -vector(a)]

vector(p) = (2 i + j - 3 k) - (5 i + 3 j + 7 k)

vector(p) = (-3 i - 2 j - 10 k) ; Here vector(p) is a vector parallel to the straight line

Choosing the position vector (5 i + 3 j + 7 k)

The required equation of the straight line

L: vector(r) = (5 i + 3 j + 7 k) + t . (-3 i - 2 j - 10 k)

Example 4: If a straight line is passing through the two fixed points in the 3-dimensional whose position coordinates are A (2, -1, 3) and B (4, 2, 1) then its cartesian equation using the two-point form is given by

Solution:

l = (4 - 2), m = (2 - (-1)), n = (1 - 3)

l = 2, m = 3, n = -2

Choosing the point A (2, -1, 3)

The required equation of the line

L : (x - 2) / 2 = (y + 1) /  3 = (z - 3) / -2 or

L : (x - 2) / 2 = (y + 1) /  3 = (3 - z) / 2

Example 5:If a straight line is passing through the two fixed points in the 3-dimensional whose position coordinates are X (2, 3, 4) and Y (5, 3, 10) then its cartesian equation using the two-point form is given by

Solution:

l = (5 - 2), m = (3 - 3), n = (10 - 4)

l = 3, m = 0, n = 6

Choosing the point X (2, 3, 4)

The required equation of the line

L : (x - 2) / 3 = (y - 3) /  0 = (z - 4) / 6 or

L : (x - 2) / 1 = (y - 3) /  0 = (z - 4) / 2

Conclusion

Equation of a line is a fundamental concept in geometry and algebra that allows us to describe precisely the relationship between points in a plane. Understanding the various forms of line equations, such as slope-intercept, point-slope, and general form, equips us with the tools to solve a wide range of problems, from basic graphing to complex spatial analysis.

Suggested Quiz
10 Questions

What is the primary characteristic of the slope-intercept form of a line?

  • A

    It defines a line using two points.

  • B

    It expresses a line in terms of its slope and y-intercept.

  • C

    It uses direction ratios to describe the line.

  • D

    It represents a line through its normal vector.

Explanation:

It expresses a line in terms of its slope and y-intercept.

The slope-intercept form is written as: y = mx + c:

where m represents the slope, and c represents the y-intercept.

In the Cartesian form of a line in 3D space, which of the following represents the relationship between the coordinates of two points on the line?

  • A

    (x - x₁)/(x₂ - x₁) = (y - y₁)/(y₂ - y₁) = (z - z1)/(z2 - z1)

  • B

    (x - x₁)/(y₂ - y₁) = (y - y₂)/(x₂ - x₁)

  • C

    (x - y₁)/(y - x₂) = (z - z₁)/(z₂ - z₁)

  • D

    (x + x₁)/(x₂ + y₁) = (y + y₂)/(z - z₁)

Explanation:

The correct relationship between the coordinates of two points on a line in 3D space in Cartesian form is: (x - x₁)/(x₂ - x₁) = (y - y₁)/(y₂ - y₁) = (z - z1)/(z2 - z1).

This equation represents the parametric relationship between the coordinates (x, y, z) of any point on the line and two known points, (x1, y1, z1)​ and (x₂, y₂, z₂), that lie on the line.

Which of the following describes the normal form of a line in relation to the angle it makes with the x-axis?

  • A

    y = mx + b

  • B

    x cos θ + y sin θ = p

  • C

    (x - x₁)/(x₂ - x₁) = (y - y₁)/(y₂ - y₁)

  • D

    (x + y + z)/p = 1

Explanation:

The normal form of a line in relation to the angle it makes with the x-axis is: x cos θ + y sin θ = p

This equation represents the normal form of a line, where:

  • θ is the angle between the normal to the line and the positive x-axis.
  • p is the perpendicular distance from the origin to the line.

In vector form, how is the equation of a line through two points A and B represented?

  • A

    r = a + λ(b - a)

  • B

    r = a + b + λd

  • C

    r =  (x₀ + t a, y₀ + t b, z₀ + t c)

  • D

    r = (x₁, y₁, z₁) + t(a, b, c)

Explanation:

The correct representation of the equation of a line through two points A and B in vector form is: r = a + λ(b − a)

Here:

  • a is the position vector of point A,
  • b is the position vector of point B,
  • λ is a scalar parameter that varies along the line,
  • b − a represents the direction vector of the line.

Which form is best suited for describing a line with known x- and y-intercepts?

  • A

    x/a + y/b = 1

  • B

    y = mx + b

  • C

    ax + by + c = 0

  • D

    r = a + λ(b − a)

Explanation:

The form best suited for describing a line with known x- and y-intercepts is: x/a​ + y/a​ = 1
This is known as the intercept form of a line, where a is the x-intercept and b is the y-intercept. This form directly incorporates both intercepts, making it the most efficient for this purpose.

What is the vector equation of a line passing through the point (2, 1, 3) and parallel to the vector 3𝑖 − 2𝑗 + 𝑘?

  • A

    r = 2i - j - 3k - λ(3i − 2j + k)

  • B

    r = 2i + j + 3k + λ(3i − 2j + k)

  • C

    r = 2i + j + 3k - λ(3i − 2j + k)

  • D

    r = 2i + j + 3k + λ(3i + 2j + k)

Explanation:

The vector equation of a line in three-dimensional space can be represented as: r = p + λd

Given:
The point (2, 1, 3) gives the position vector p = 2i + j + 3k.
The vector parallel to the line is d = 3i − 2j + k.

Substituting these into the vector equation of the line, we get: r = (2i + j + 3k) + λ(3i − 2j + k)
r = 2i + j + 3k + λ(3i − 2j + k)

A line passes through the point (1, 2, 3) and is parallel to the vector v = 4, -5, 6 Determine the point of intersection of this line with the plane defined by the equation (2x - y + z = 7).

  • A

    [Tex]{\left(\frac{27}{19}, \frac{28}{19}, \frac{69}{19}\right)}[/Tex]

  • B

    [Tex]{\left(\frac{29}{19}, \frac{36}{19}, \frac{69}{19}\right)}[/Tex]

  • C

    [Tex]{\left(\frac{2}{19}, \frac{8}{19}, \frac{9}{19}\right)}[/Tex]

  • D

    None

Explanation:

To find the intersection of the line through (1, 2, 3) with direction vector ⟨4, −5, 6⟩ and the plane 2x − y + z = 7,
substitute the parametric equations of the line into the plane equation: x = 1 + 4t, y = 2 - 5t, z = 3 + 6t
2 + 8t - 2 + 5t + 3 + 6t = 7
19t + 5 = 7
t = 2/19
Substitute t =2/19 back into the parametric equations to find the intersection point.
[Tex]{\left(\frac{27}{19}, \frac{28}{19}, \frac{69}{19}\right)}[/Tex]

Find the equation of the line that passes through the point (2, −3) and is parallel to the line passing through the points (5, 1) and (7, 5).

  • A

    y = 2x - 7

  • B

    y = 2x + 7

  • C

    y = 7x - 2

  • D

    y = 7x + 2

Explanation:

Since parallel lines have the same slope, the slope of the new line is also 2.
We can use the point-slope form of the line equation: y - y1 = m(x - x1)

Substitute the known point (2, −3) and slope m = 2:
y - (-3) = 2(x - 2)
y + 3 = 2x - 4
y = 2x - 7

Find the equation of the line that makes an angle of 60with the positive direction of the x-axis and cuts off an intercept of 6 units with the negative direction of the y-axis.

  • A

    √3​x − y − 6 = 0

  • B

    √3​x + y − 6 = 0

  • C

    √3​x + y + 6 = 0

  • D

    -√3​x + y − 6 = 0

Explanation:

The angle θ = 60 that the line makes with the positive direction of the x-axis helps us determine the slope m of the line.
The slope is given by the tangent of the angle: m = tan(θ) = tan(60)
tan(60) = √3, so the slope m is √3.

The line cuts off an intercept of 6 units with the negative direction of the y-axis. This means the y-intercept b is -6.
The equation of a line in slope-intercept form is: y = mx + b

Substituting the values of m and b: y = √3x - 6

Given points A(2, 3) and B(5, -1), find the equation of the line that is perpendicular to the line passing through these points and passes through the midpoint of segment AB.

  • A

    y = (3/4)x - 8/13

  • B

    y = (3/4)x - 3/8

  • C

    y = (3/4)x - 13/8

  • D

    y = (4/3)x - 13/8

Explanation:

Find the slope of line AB: The slope m is given by:
m = y2​ − y1/x2 ​− x1
​​​= −1 −3/5 − 2
​= − 4​/3
Find the midpoint of AB: The midpoint is: ((2 + 5​)/2, (3 + ( −1))/2​)
= (7/2​, 1)

Using the point-slope form y − y1 ​= m(x − x1​) with the midpoint (7/2​, 1) and slope 3/4​:
y - 1 = 3/4(x - 7/2
Simplifying:
y = (3/4)x - 8/13

Quiz Completed Successfully
Your Score :   2/10
Accuracy :  0%
Login to View Explanation
1/10 1/10 < Previous Next >

Similar Reads