Skip to content

Instantly share code, notes, and snippets.

View weijuer's full-sized avatar
🎯
闭关

Weijuer weijuer

🎯
闭关
View GitHub Profile
@xem
xem / readme.md
Last active December 7, 2025 16:33
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;