Welcome

This is a beginner-to-intermediate trigonometry course written for software developers. Every concept pairs math notation with runnable code so you can see how trig shows up in graphics, games, data science, robotics, and web development.

Learning path

Work through the units in sidebar order. Each unit is a folder of lessons; each lesson ends with practice problems and runnable code.

  1. Unit 1: Foundations — what trig is, degrees vs radians, SOH-CAH-TOA.
  2. Unit 2: Circles & Triangles — the unit circle, special right triangles, Laws of Sines and Cosines.
  3. Unit 3: Functions & Identities — sine/cosine waves, core identities, inverse trig and atan2.
  4. Unit 4: Trig in Code — capstone recipes: rotations, oscillations, canvas/SVG, bug gallery, plus a live JS playground.
  5. Unit 5: Games & Graphics Projects — build a canvas clock, a projectile lab, and a mouse-aimed turret game.
  6. Unit 6: Waves, Sound & the Real World — Web Audio tones and beats, sine easing, map bearings and GPS distances.

Plus a standalone JS Playground — an interactive canvas + page runner. Every JavaScript snippet in the course has a Run in playground button that loads it there automatically.

How to read the math

Block formulas are rendered with KaTeX:

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

Inline symbols like \(\theta\), \(\sin\), \(\cos\) appear in text. If math does not render, make sure JavaScript is enabled (KaTeX runs client-side).

How to run the code

Python snippets assume Python 3 with only the standard library (math):

import math
print(math.sin(math.pi / 6))  # 0.5

JavaScript snippets run in a browser console or Node.js. Remember: Math.sin, Math.cos, Math.tan all take radians, not degrees.

console.log(Math.sin(Math.PI / 6)); // 0.5

Try every snippet yourself. Change the angle, predict the output, then run it — that is the fastest way to build intuition.