NapkinCalc

Trigonometry

Any triangle: law of cosines

continues from lesson 3 — values defined earlier in the course stay live here

The law of cosines finds the third side from two sides and the angle between them — it is the Pythagorean theorem plus a correction term for the angle not being 90°: c² = a² + b² − 2ab·cos(γ).

sidep=7side_{p} = 7 first side
sideq=5side_{q} = 5 second side
γ:=49deg\gamma := 49 deg = 49 deg the angle between them
sider=sidep2+sideq22sidepsideqcos(γ)side_{r} = \sqrt{side_{p}^{2} + side_{q}^{2} - 2 \cdot side_{p} \cdot side_{q} \cdot \mathrm{cos}\left(\gamma\right)} = 5.29875.2987 the side opposite γ

triangle(side_p, side_q, side_r)

5.2997585.59°A45.41°B49°C

find the 49° at vertex C

Set gamma to 90 deg: the correction term vanishes (cos 90° = 0) and the formula collapses back to Pythagoras.