🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Three Dimensional Geometry - Lines

CBSE Class 12 Maths3D GeometryđŸŸĸ Free Lesson

Because the direction cosines are forced to sum of squares 1, they are unique up to an overall sign, while direction ratios come in whole families — , and all describe the same direction. Any member can serve in the equations; the direction cosines are simply the member with chosen so that .

Equation of Line in 3D

Vector Form

Cartesian Form

Reading the vector form as a recipe for points is the fastest habit to build: each value of names exactly one point on the line, and every point on the line has exactly one . Expanding coordinate by coordinate produces the parametric equations , , — three equations wearing the disguise of one fraction chain. Setting a common value for the three fractions in the Cartesian form recovers , so the two forms carry identical information.

Equation of Line Through Two Points

The differences , , serve as ready-made direction ratios: the vector from the first point to the second obviously points along the line. No extra normalisation is required — direction ratios are defined only up to a common factor, so raw coordinate differences are always acceptable.

Example: Find Equation of Line

Find the equation of the line passing through and parallel to .

Example: Line Through Two Points

Find the equation of the line through and .

Does a Point Lie on the Line?

To test whether a candidate point sits on the line, substitute its coordinates into the parametric equations and solve for from any component where the direction ratio is nonzero. A single consistent value across all three components puts on the line; a mismatch kills it. For the line , the point gives in every slot — , , — so it lies on the line. The point yields from , from , and from : three different parameters, so the point is off the line. Exam problems dress this test up as "show that three points are collinear" — run the parameter check from the first point through the other two and compare.

Angle Between Two Lines

The absolute value around the dot product returns the acute angle between the lines, matching the convention that "the angle between two lines" is never taken as obtuse — lines carry no forward orientation, so the supplementary angle describes the same pair.

Skew Lines

The coplanarity test is a scalar triple product. Form — perpendicular to both directions — and dot it with , the step between the two base points. If that triple product vanishes, the displacement between the lines lies in the shared direction plane, so the lines either meet or run parallel; if it is nonzero, the lines are skew, and its magnitude divided by gives the shortest distance. The dedicated shortest-distance lesson carries the full derivation; the practical point here is that the test needs one cross product and one dot product, no coordinates solving required.

python
import math

def param(a, drs, lam):
    return tuple(a[i] + lam * drs[i] for i in range(3))

def on_line(p, a, drs, tol=1e-9):
    params = [(p[i] - a[i]) / drs[i] for i in range(3) if drs[i] != 0]
    return all(abs(lam - params[0]) < tol for lam in params)

def angle_deg(u, v):
    num = abs(sum(u[i] * v[i] for i in range(3)))
    den = math.sqrt(sum(x * x for x in u)) * math.sqrt(sum(y * y for y in v))
    return round(math.degrees(math.acos(num / den)), 4)

A, dirs = (1, 2, 3), (2, -1, 3)
print(param(A, dirs, 2))          # (5, 1, 9): lambda = 2 lands exactly on the line
print(on_line((5, 1, 9), A, dirs))   # True
print(on_line((3, 4, 5), A, dirs))   # False: no single lambda fits all three coordinates
print(angle_deg((2, -1, 3), (1, 4, -1)))   # 71.5992 — the acute angle in degrees
python
import math

def cross(u, v):
    return (u[1]*v[2] - u[2]*v[1],
            u[2]*v[0] - u[0]*v[2],
            u[0]*v[1] - u[1]*v[0])

def dot(u, v):
    return sum(u[i] * v[i] for i in range(3))

def shortest_distance(a1, b1, a2, b2):
    n = cross(b1, b2)
    if n == (0, 0, 0):
        return None                     # parallel lines need the point-to-line formula
    diff = tuple(a2[i] - a1[i] for i in range(3))
    return abs(dot(n, diff)) / math.sqrt(dot(n, n))

d = shortest_distance((1, 2, 3), (2, -1, 3), (0, 1, -1), (1, 4, -1))
print(round(d, 4))                      # 1.9912 — the lines are skew, not intersecting

Reading Direction Cosines From Direction Ratios

Normalising any direction-ratio triple produces the direction cosines. For the magnitude is , so

The corresponding angles are , and , obtained by taking arccosines. Notice that only exceeds 90°, which is exactly what a negative second component demands — the sign of each direction ratio decides whether the line leans with or against that axis. Projections use the same numbers: the foot of the perpendicular from a point onto the line, and the distance from the point to the line, both fall out of computed from a dot-product formula with these cosines.

Common Mistakes

Treating the three fractions of a Cartesian line equation as independent equations

Fix: They are chained equalities: solve for a single parameter and verify it consistently in all three components before declaring a point collinear.

Reporting the obtuse angle between two lines when the raw dot product comes out negative

Fix: Take the absolute value of the dot product in the cosine formula; the angle between lines is defined as the acute one.

Normalising direction ratios before using them in an equation of the line

Fix: Skip the normalisation for line equations — any nonzero multiple works; reserve normalisation for direction cosines and projection formulas.

Key Takeaways

  • A line in 3D is fixed by one point and one direction: vector form r = a + lambda b and the Cartesian fraction chain carry the same parameter lambda.
  • Direction ratios are any proportional triple; direction cosines are the unique normalised triple with squares summing to one.
  • Collinearity and angle questions both reduce to parameter matching and a single dot product of direction ratios.
  • Skew lines are detected by a nonzero scalar triple product, and the shortest distance between them is that triple product over the magnitude of the cross product of directions.
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-15

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert CBSE Class 12 Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement