Academy
Formulas/maths/3d Geometry/Angle Between Two Lines (Direction Cosines)

Angle Between Two Lines (Direction Cosines)

Acute angle θ between two lines with direction cosines (l₁, m₁, n₁) and (l₂, m₂, n₂). The absolute value ensures the acute angle is taken.
Derivation

Let two lines have direction cosines (l1,m1,n1)(l_1, m_1, n_1) and (l2,m2,n2)(l_2, m_2, n_2). Their unit direction vectors are u^1=(l1,m1,n1)\hat{u}_1 = (l_1, m_1, n_1) and u^2=(l2,m2,n2)\hat{u}_2 = (l_2, m_2, n_2).

The angle θ\theta between the lines satisfies:

cosθ=u^1u^2=l1l2+m1m2+n1n2\cos\theta = \hat{u}_1 \cdot \hat{u}_2 = l_1l_2+m_1m_2+n_1n_2

Since each vector is a unit vector, u^1u^2=1|\hat{u}_1||\hat{u}_2| = 1, so no normalization is needed.

Taking the acute angle: cosθ=l1l2+m1m2+n1n2\cos\theta = |l_1l_2+m_1m_2+n_1n_2|.

Perpendicularity: l1l2+m1m2+n1n2=0l_1l_2+m_1m_2+n_1n_2 = 0.

Parallelism: l1=l2l_1 = l_2, m1=m2m_1 = m_2, n1=n2n_1 = n_2 (same direction) or all negatives (opposite direction).

Note on angle between skew lines: Two lines in 3D that do not intersect (skew lines) still have a well-defined angle — it is the angle between their direction vectors, as if translated to meet at a point.