Every spatial angle becomes one cosine you can compute from coordinates.
Angles in space have a reputation. Find the angle between two pipes that pass without touching; the angle a ramp makes with the floor; the angle along the spine of an open book. The picture is hard to draw and harder to measure — but every one of these collapses to a single number once you reach for vectors. Hand a line its direction vector d and a plane its normal vector n, and the dot product a·b = |a||b|cos θ from Stage 27 turns each angle into a cosine you compute from coordinates. The three formulas below are really one idea wearing three coats — and the only thing that ever trips a careful student is a sign or an absolute value.
We lean on three tools you already own: the direction vector of a line and the normal vector of a plane from 29.3; the coordinate dot product a·b = x₁x₂ + y₁y₂ + z₁z₂ and length |a| = √(x²+y²+z²) from 29.2; and the rule cos θ = (a·b)/(|a||b|) that reads an angle off two vectors. Set axes at a square corner, write coordinates, and every spatial angle becomes arithmetic.
Two lines in space need not meet. Skew lines run past each other — different directions, no crossing point, like a highway over a side street. There is no vertex to stand at, so the “angle between them” is defined by sliding one line over until it meets the other and measuring there. With vectors you skip the sliding entirely: the angle between two lines is just the angle between their direction vectors d₁ and d₂.
One subtlety. A direction vector can point either way along its line — d or −d name the same line — so the raw dot product might hand you an obtuse number. The angle between two lines is taken to be the acute one (0° < θ ≤ 90°), so we clamp it with an absolute value:
Worked example, in a cube of edge 2 (set up with cubeNamed so the numbers are real). Take the space diagonal AC₁→ = C₁ − A = (2, 2, 2) and the face diagonal AB₁→ = B₁ − A = (2, 0, 2). Then d₁·d₂ = 2·2 + 2·0 + 2·2 = 8, |d₁| = √12 ≈ 3.46, |d₂| = √8 ≈ 2.83, so
cos θ = |8| / (√12 · √8) = 8 / √96 ≈ 0.82, θ = arccos(0.82) ≈ 35.26°.
The angle between two lines is the angle between their direction vectors, taken acute: cos θ = |d₁·d₂| / (|d₁||d₂|). It needs no crossing point, so it works for skew lines exactly as it does for intersecting ones.
Drop the absolute value and you may report an obtuse “angle.” Reversing a direction vector to −d flips the sign of d₁·d₂ but cannot change the lines — the |·| is what keeps the answer honest and acute.
Now tilt a line into a plane — a ramp meeting the floor. The line–plane angle θ is the angle between the line and its shadow on the plane, the smallest angle the line makes with any line in the plane. The plane carries a normal n sticking straight up. Here is the trick: the angle between the line's direction d and the normal n is the complement of θ — when the line lies flat in the plane it is 90° from the normal, and when the line stands straight up it is 0° from the normal.
Because cos(90° − θ) = sin θ, the cosine formula for the angle with n becomes a sine formula for the angle with the plane:
Two readings check the formula. If d·n = 0, the line is perpendicular to the normal, hence parallel to the plane: sin θ = 0, θ = 0°. If d ∥ n, the line is perpendicular to the plane: sin θ = 1, θ = 90°. Worked example: the space diagonal AC₁→ = (2, 2, 2) against the base, whose normal is n = (0, 0, 1). Then d·n = 2, |d| = √12, |n| = 1, so sin θ = 2/√12 ≈ 0.58 and θ ≈ 35.26° — the tilt of a cube's diagonal off its floor.
The line–plane angle uses sin, not cos — because the easy quantity, d·n, measures the angle to the normal, and the line–plane angle is its complement. Reach for cos here and you will report the angle to the flagpole, not to the floor.
A dihedral angle is the opening between two half-planes that share an edge — the spine of an open book, the ridge of a roof, the crease where two walls meet. To measure it the old way you stand on the edge and draw a ray in each face perpendicular to the edge; the angle between those rays is the dihedral. That works, but finding two perpendicular rays in space is fiddly.
Vectors offer a shortcut. Each face has a normal vector — n₁ for the first face, n₂ for the second. The angle between n₁ and n₂ is locked to the dihedral angle: it equals the dihedral angle or its supplement, depending on which way each normal points. So compute
Why the ±? A normal can point “out” of a face or “in.” If both normals point outward (or both inward), the angle between them is the supplement of the dihedral; if one points out and the other in, it is the dihedral itself. The arithmetic gives you a number; the picture tells you whether to keep it or subtract from 180°. That is the whole art of this section: compute the normals' angle, then look at the figure and decide θ or 180° − θ.
Let's make the supplement subtlety concrete with an open book hinged at the x-axis. Worked example along the spine: a cube of edge 2, the dihedral along edge AB between the base ABCD and the slanted plane ABC₁D₁ that lifts the far edge up to the top. The base normal is n₁ = (0, 0, 1). For the slant, span it with AB→ = (2, 0, 0) and AD₁→ = (0, 2, 2) and cross them: n₂ = AB→ × AD₁→ = (0, −4, 4). Then
cos(angle of normals) = (0·0 + 0·(−4) + 1·4) / (1 · √32) = 4/√32 ≈ 0.71, so the normals are 45° apart.
Read the figure: the slant rises gently off the base, so the dihedral is acute — here it is the 45° the normals report. But change which way a normal points and the same arithmetic would read 135°; only the picture distinguishes them. The widget below makes this unmistakable.
At rise 2 the open book reads a dihedral of 135°, while the two normals (both aimed upward) sit only 45° apart — exactly 180° − 135°. The dot product alone would have whispered “45°.” The figure is what tells you the book is open wide, not nearly shut.
The dihedral angle is the normals' angle or its supplement — never blindly report arccos of n₁·n₂. There is no absolute value in the dihedral formula precisely because the sign and the supplement carry real information. Always glance at the picture: is the opening acute or obtuse?
Three formulas, one habit. Whatever the angle, you set coordinates and reach for the matching cosine:
| The angle is between… | Use the vectors… | Formula | Note |
|---|---|---|---|
| two lines (incl. skew) | directions d₁, d₂ | cos θ = |d₁·d₂| / (|d₁||d₂|) | acute — keep |·| |
| a line and a plane | direction d, normal n | sin θ = |d·n| / (|d||n|) | sin, not cos |
| two planes (dihedral) | normals n₁, n₂ | cos θ = ± n₁·n₂ / (|n₁||n₂|) | θ or 180° − θ: read the figure |
Full worked routine, the angle between the base diagonal and the space diagonal in our cube. (i) Set axes at corner A. (ii) Write coordinates: the base diagonal direction is AC→ = (2, 2, 0); the space diagonal is A₁C→ = C − A₁ = (2, 2, −2) (it runs from the top corner A₁ to the opposite bottom corner C, so |A₁C→| = √12 = 2√3). (iii) These are line directions, so use the skew-line formula. (iv) d₁·d₂ = 2·2 + 2·2 + 0·(−2) = 8, |d₁| = √8, |d₂| = √12. (v) cos θ = 8/(√8·√12) = 8/√96 ≈ 0.82, so θ ≈ 35.26°. The same five steps — axes, coordinates, vectors, formula, answer — solve any angle in any solid.
You never guess a spatial angle again. Find the right d's and n's, pick the row of the table that matches, and plug in. The hard geometry has become a dot product and a square root.
Three angles, three formulas, one mindset: turn the geometry into vectors, then read the angle off a dot product.
| Angle | Formula | Function | Caution |
|---|---|---|---|
| line & line (skew or not) | cos θ = |d₁·d₂| / (|d₁||d₂|) | cos | keep |·| → acute |
| line & plane | sin θ = |d·n| / (|d||n|) | sin | it's the complement of the angle to n |
| plane & plane (dihedral) | cos θ = ± n₁·n₂ / (|n₁||n₂|) | cos | θ or 180° − θ — read the figure |
Special readings worth memorizing: for a line and plane, d·n = 0 ⇒ θ = 0° (line ∥ plane) and d ∥ n ⇒ θ = 90° (line ⊥ plane). The skew and line–plane formulas always take the absolute value; the dihedral formula never does — that is the cleanest way to remember which is which. Next, in 29.5, the same normal vector that gave us angles will give us distances: a point's distance to a plane is the length of its shadow on n.
Six questions to lock it in. Tap the answer you think is right.
This lesson lives in the high-school Vector & Matrix Quantities standards (HSN-VM): it adds spatial vectors, scales them, and uses the dot product to read angles — here, three spatial angles (line–line, line–plane, dihedral). It also serves the geometric-modeling strand (HSG-GMD and HSG-MG) by turning questions about real solids — ramps, roofs, crystal faces — into coordinate computations. The recurring lesson is conceptual, not computational: the dot product is one tool, but each angle needs the right framing (absolute value for acute line angles; sine for the line–plane angle; and a figure-reading judgment of θ versus 180° − θ for the dihedral). Encourage students to always sketch and ask “acute or obtuse?” before trusting the arithmetic.