Trigonometry B — Waves & the Triangle Laws
Any triangle: the law of cosines
continues from lesson 1 — values defined earlier in the course stay live here
ELI5: the law of cosines is Pythagoras with a correction for when the angle isn't 90°. Two sides and the angle between them give the third: c² = a² + b² − 2ab·cos(γ). (When γ = 90°, cos γ = 0 and it collapses back to a² + b².)
first side
second side
= 49 deg the angle between them
= the side opposite γ
triangle(side_p, side_q, side_r)
the triangle, drawn to scale
Real-world hook: the law of cosines finds the straight-line distance across a bent path — a plane's two-leg flight, the gap between two runners who set off at an angle, the diagonal of a non-rectangular plot of land.
Try it yourself: a triangle has sides 8 and 6 with a 60° angle between them. How long is the third side?
= ✏️ Your turn: find the third side via the law of cosines. The check verifies r² = 8² + 6² − 2·8·6·cos 60° — without revealing r.
✓ pass green when your side satisfies the law of cosines