Skip to content

Instantly share code, notes, and snippets.

View talltyler's full-sized avatar

Tyler Larson talltyler

  • New York, NY
View GitHub Profile
@xem
xem / readme.md
Last active April 18, 2025 20:19
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;