Skip to main content

Calculating angles between lines in space using vectors

2026-10-22 huynhvietkhanh Comments: 0

Use nonzero direction vectors and the absolute-value dot-product formula, with checked cube diagonal examples.

High schoolSolid Geometry & Vectors

Content updated: October 22, 2026

To calculate the angle between lines in a solid, choose direction vectors and calculate their dot product. The lines need not intersect, but the edge relations must be known correctly.

Learning goals: use the absolute-value cosine formula, express direction vectors in terms of edges, and check hypotheses and results in a cube.

Prerequisites: line angles and vector angles, the dot product, and the parallelogram and parallelepiped rules.

1. The conventional angle between lines

Choose $\vec u,\vec v\ne\vec0$ as direction vectors of $d_1,d_2$. If their vector angle is $\theta\in[0^\circ;180^\circ]$, the line angle $\varphi$ satisfies $\varphi=\min\{\theta,180^\circ-\theta\}\in[0^\circ;90^\circ]$. The two angles are equal or supplementary.

Line and vector anglesTwo unoriented lines meet at an acute angle. The chosen direction vectors may make the supplementary obtuse angle. This schematic illustrates a vector angle of 45 degrees and the same line angle.φd₁d₂u₁u₂α = φ = 45°
New schematic: the two direction vectors make a nonobtuse angle.
Line and vector anglesTwo unoriented lines meet at an acute angle. The chosen direction vectors may make the supplementary obtuse angle. This schematic illustrates a vector angle of 135 degrees and a line angle of 45 degrees.φd₁d₂u₁u₂α = 135°; φ = 45°
New schematic: take the supplement of an obtuse vector angle to obtain the line angle.

A line has no preferred orientation. Replacing a direction vector by its negative preserves the line, so the angle formula must remove the effect of sign changes. If a vector is zero, its length makes the denominator $0$ and the angle formula does not apply; always choose two nonzero vectors.

2. Formula and procedure

$$\cos\varphi=\frac{|\vec u\cdot\vec v|}{\|\vec u\|\,\|\vec v\|}.$$

First choose direction vectors, calculate their dot product, and calculate each length. Simplify the ratio, then find $\varphi$ in the range $0^\circ$–$90^\circ$. The Cauchy–Schwarz inequality ensures that the ratio belongs to $[0;1]$. If the result is negative or greater than $1$, check the calculation before finding an angle.

In a cube of edge length $a>0$, the three edge vectors starting at one vertex are pairwise perpendicular and all have length $a$. These are geometric properties of the cube, not measurements from a perspective sketch. For an arbitrary parallelepiped, edge dot products are not assumed to be $0$.

3. Worked examples

Example 1. The angle between AC and DE in a cube

Let $ABCD.EFGH$ be a cube of edge length $a>0$, with $E,F,G,H$ above $A,B,C,D$, respectively, and corresponding edges $AE,BF,CG,DH$. Calculate the angle between $AC$ and $DE$.

Set $\vec u=\overrightarrow{AB}$, $\vec v=\overrightarrow{AD}$, and $\vec w=\overrightarrow{AE}$. Then $\overrightarrow{AC}=\vec u+\vec v$ and $\overrightarrow{DE}=-\vec v+\vec w$. Also, $\overrightarrow{DE}=\overrightarrow{DA}+\overrightarrow{DH}$ since $\overrightarrow{DH}=\overrightarrow{AE}$.

Directions AC and DE in a cubeABCD.EFGH is a cube, with E,F,G,H corresponding to A,B,C,D. The highlighted vectors AC and DE have an angle of 120 degrees, and their unoriented lines have an angle of 60 degrees. Projected angles are not measurements.ABCDEFGHCube: AB, AD, AE are pairwise perpendicular and equal.Vector angle: 120°; line angle: 60°.
New schematic: the cube has the corresponding vertices specified in the problem.

Since the three edges are pairwise perpendicular and have the same length $a$,

$$\overrightarrow{AC}\cdot\overrightarrow{DE}=(\vec u+\vec v)\cdot(-\vec v+\vec w)=-\|\vec v\|^2=-a^2.$$

The segments $AC,DE$ are diagonals of square faces, each with length $a\sqrt2$. Thus $\cos\varphi=|-a^2|/(a\sqrt2\,a\sqrt2)=1/2$, so the line angle is $60^\circ$. The chosen direction vectors have angle $120^\circ$; the absolute value produces the line angle.

Example 2. Reversing direction preserves the answer

In the same figure, choose $\overrightarrow{ED}=-\overrightarrow{DE}$ in place of $\overrightarrow{DE}$. Its dot product with $\overrightarrow{AC}$ becomes $a^2$, but the lengths and absolute value remain unchanged. The angle between $AC$ and $ED$ is still $60^\circ$, since $ED$ and $DE$ denote the same line.

Example 3. Another angle in the same solid

Calculate the angle between $AC$ and $AB$. We have $(\vec u+\vec v)\cdot\vec u=a^2$, and the lengths are $a\sqrt2$ and $a$. Thus the cosine is $1/\sqrt2$, and the angle is $45^\circ$. Do not substitute the angle between adjacent edges for the angle between a diagonal and an edge.

4. Practice

  1. In the cube of Example 1, calculate the angle between $AB$ and $DH$.
  2. Calculate the angle between $AC$ and $BD$ in the base of the cube.
  3. Calculate the angle between the space diagonal $AG$ and edge $AB$.
Hints and answers
  1. The direction vectors $\vec u$ and $\vec w$ are perpendicular, so the angle is $90^\circ$. The lines need not have a common point.
  2. Direction vectors are $\vec u+\vec v$ and $\vec v-\vec u$. Their dot product is $a^2-a^2=0$, so the angle is $90^\circ$.
  3. $\overrightarrow{AG}=\vec u+\vec v+\vec w$ has length $a\sqrt3$, and its dot product with $\vec u$ equals $a^2$. Thus $\cos\varphi=1/\sqrt3$, or $\varphi=\arccos(1/\sqrt3)$, approximately $54.74^\circ$.

5. Common mistakes

Use direction vectors; do not call them normal vectors of the lines. Retain the absolute value and distinguish the two angle ranges. Do not apply cube properties to an oblique parallelepiped, and always specify corresponding vertex pairs.

6. Further study and sources

Vector angles and line angles in space (English lesson) · The dot product and its applications (English lesson) · Perpendicular lines (English lesson) · The angle between lines in space (English lesson).

Original resource on Scribd (external link).

Leave a Reply

Your email address will not be published. Required fields are marked *