Fundamental Identities
Why identities matter
Identities are equations true for every angle. They let you rewrite expressions, verify code (e.g. assert \(\sin^2 + \cos^2 \approx 1\)), and simplify shaders or physics formulas before implementing them.
Pythagorean identities
From \(x^2 + y^2 = 1\) on the unit circle, with \(x = \cos\theta\), \(y = \sin\theta\):
Dividing by \(\cos^2\theta\) or \(\sin^2\theta\) gives the other two:
Use them to find one function from another. Example: \(\sin\theta = 3/5\), QI. Then:
(Take the positive root in QI; choose the sign by quadrant otherwise.)
Reciprocal and quotient
Cofunction and supplements
Cofunctions swap at \(90° − \theta\) (the two acute angles of a right triangle are complementary):
Negation (even/odd):
Supplementary angles (\(180° − \theta\)):
Simplification examples
Example 1. Simplify \(\dfrac{\sin\theta}{\cos\theta} \cdot \cos^2\theta\):
Example 2. Verify \((1 - \sin x)(1 + \sin x) = \cos^2 x\): left side is a difference of squares:
Example 3 (code). Use Pythagoras as a runtime sanity check:
import math
def trig_ok(theta, tol=1e-9):
return abs(math.sin(theta)**2 + math.cos(theta)**2 - 1.0) < tol
print(trig_ok(1.234)) # Truefunction trigOk(theta, tol = 1e-9) {
return Math.abs(Math.sin(theta) ** 2 + Math.cos(theta) ** 2 - 1) < tol;
}
console.log(trigOk(1.234)); // true
Practice
- If \(\cos\theta = -5/13\) and \(\theta\) is in QIII, find \(\sin\theta\) and \(\tan\theta\).
- Simplify: \(\sec^2\theta - \tan^2\theta\), and \(\sin^2 x + \cos^2 x + \tan^2 x - \sec^2 x\).
- Show \(\tan\theta \cdot \cos\theta = \sin\theta\) using the quotient identity.
- Write a test that asserts your
rotate()function preserves vector length (a disguised Pythagorean check).
Next: Inverse Trig Functions — going from ratios back to angles safely.