Special Right Triangles
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.
Derivation: legs \(1, 1\) → hypotenuse \(\sqrt{1^2+1^2} = \sqrt{2}\) by Pythagoras.
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.
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
- A 45-45-90 triangle has hypotenuse \(6\). Find the legs exactly and decimally.
- A 30-60-90 triangle has long leg \(5\). Find the short leg and hypotenuse.
- Without a calculator, evaluate \(\sin 45° \cdot \cos 45°\). Then verify in code.
- 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.