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 November 25, 2025 04:52
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;