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\):

$$ \sin^2\theta + \cos^2\theta = 1 $$

Dividing by \(\cos^2\theta\) or \(\sin^2\theta\) gives the other two:

$$ 1 + \tan^2\theta = \sec^2\theta, \qquad 1 + \cot^2\theta = \csc^2\theta $$

Use them to find one function from another. Example: \(\sin\theta = 3/5\), QI. Then:

$$ \cos\theta = \sqrt{1 - \sin^2\theta} = \sqrt{1 - \tfrac{9}{25}} = \tfrac{4}{5} $$

(Take the positive root in QI; choose the sign by quadrant otherwise.)

Reciprocal and quotient

$$ \csc\theta = \frac{1}{\sin\theta}, \quad \sec\theta = \frac{1}{\cos\theta}, \quad \cot\theta = \frac{1}{\tan\theta} $$
$$ \tan\theta = \frac{\sin\theta}{\cos\theta}, \qquad \cot\theta = \frac{\cos\theta}{\sin\theta} $$

Cofunction and supplements

Cofunctions swap at \(90° − \theta\) (the two acute angles of a right triangle are complementary):

$$ \sin(90^\circ - \theta) = \cos\theta, \qquad \cos(90^\circ - \theta) = \sin\theta, \qquad \tan(90^\circ - \theta) = \cot\theta $$

Negation (even/odd):

$$ \sin(-\theta) = -\sin\theta, \qquad \cos(-\theta) = \cos\theta, \qquad \tan(-\theta) = -\tan\theta $$

Supplementary angles (\(180° − \theta\)):

$$ \sin(180^\circ - \theta) = \sin\theta, \qquad \cos(180^\circ - \theta) = -\cos\theta $$

Simplification examples

Example 1. Simplify \(\dfrac{\sin\theta}{\cos\theta} \cdot \cos^2\theta\):

$$ \frac{\sin\theta}{\cos\theta} \cdot \cos^2\theta = \sin\theta\cos\theta $$

Example 2. Verify \((1 - \sin x)(1 + \sin x) = \cos^2 x\): left side is a difference of squares:

$$ 1 - \sin^2 x = \cos^2 x \quad \checkmark $$

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))  # True
function 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

  1. If \(\cos\theta = -5/13\) and \(\theta\) is in QIII, find \(\sin\theta\) and \(\tan\theta\).
  2. Simplify: \(\sec^2\theta - \tan^2\theta\), and \(\sin^2 x + \cos^2 x + \tan^2 x - \sec^2 x\).
  3. Show \(\tan\theta \cdot \cos\theta = \sin\theta\) using the quotient identity.
  4. 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.