Why “special”?

Most triangles need a calculator. Two shapes give exact values with square roots, so they appear constantly in tests, graphics (diagonals, hex grids), and interview problems.

45-45-90 (isosceles right)

Angles: 45°, 45°, 90°. Legs equal; hypotenuse is leg × √2.

$$ \text{legs } 1 : 1, \quad \text{hypotenuse } \sqrt{2} \;\; \Rightarrow \;\; 1 : 1 : \sqrt{2} $$

Derivation: legs \(1, 1\) → hypotenuse \(\sqrt{1^2+1^2} = \sqrt{2}\) by Pythagoras.

$$ \sin 45^\circ = \cos 45^\circ = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \approx 0.7071, \qquad \tan 45^\circ = 1 $$

Scaling: if a leg is \(s\), hypotenuse is \(s\sqrt{2}\); if hypotenuse is \(h\), each leg is \(h/\sqrt{2} = h\sqrt{2}/2\).

import math
def from_leg_454590(s): return s * math.sqrt(2)   # hypotenuse
def from_hyp_454590(h): return h / math.sqrt(2)   # leg
print(from_leg_454590(5))  # 7.071...

30-60-90 (half-equilateral)

Angles: 30°, 60°, 90°. Start from an equilateral triangle of side 2, cut in half: short leg 1, hypotenuse 2, long leg √3.

$$ 1 : \sqrt{3} : 2 \quad (\text{short} : \text{long} : \text{hypotenuse}) $$
$$ \sin 30^\circ = \frac{1}{2}, \quad \cos 30^\circ = \frac{\sqrt{3}}{2}, \quad \tan 30^\circ = \frac{1}{\sqrt{3}} = \frac{\sqrt{3}}{3} $$
$$ \sin 60^\circ = \frac{\sqrt{3}}{2}, \quad \cos 60^\circ = \frac{1}{2}, \quad \tan 60^\circ = \sqrt{3} $$

Memory aid: for \(\sin\) at 0°, 30°, 45°, 60°, 90°, numerators are \(\sqrt{0}, \sqrt{1}, \sqrt{2}, \sqrt{3}, \sqrt{4}\) all over 2.

Quick reference table

\(\theta\) \(\sin\) \(\cos\) \(\tan\)
30° 1/2 √3/2 1/√3
45° √2/2 √2/2 1
60° √3/2 1/2 √3

Worked examples

Example 1. Hypotenuse 10, angles 45-45-90. Legs = \(10/\sqrt{2} = 5\sqrt{2} \approx 7.07\).

Example 2. Short leg 4 in a 30-60-90. Hypotenuse = 8, long leg = \(4\sqrt{3} \approx 6.93\).

Example 3 (dev). A square sprite of side 100 rotated 45°: its diagonal is \(100\sqrt{2} \approx 141.4\). That is the bounding-box size you need — no measuring required.

const side = 100;
const diagonal = side * Math.SQRT2; // 141.42...
console.log(diagonal);

Practice

  1. A 45-45-90 triangle has hypotenuse \(6\). Find the legs exactly and decimally.
  2. A 30-60-90 triangle has long leg \(5\). Find the short leg and hypotenuse.
  3. Without a calculator, evaluate \(\sin 45° \cdot \cos 45°\). Then verify in code.
  4. A hexagon (6 equilateral triangles) has side 10. What is the distance between opposite vertices? Between opposite flat sides? (Hints: 20 and \(10\sqrt{3}\).)

Next: Solving Triangles — Law of Sines and Cosines for non-right triangles.