🧮 How To Write Fast Game Engine Math

March 22, 2026Mason Remaleytechgamedevmath

Text Version
  1. Are you in a linear space?
    • YES:
      • Congratulations, things are easy and fast!
      • Task Complete.
    • No:
      • GOTO 2.
  2. Can you easily get into one?
    • YES:
      • GOTO 1.
    • NO:
      • GOTO 3.
  3. Can you pretend the space is linear?
    • YES:
      • GOTO 1.
    • NO:
      • Zoom in on the graph.
      • GOTO 3.

Following these steps results in apparent black magic such as replacing inverse square roots with -0.5*x + 1.5, or replacing the quaternion log/exponent with truncation/extension of the imaginary component.

I’ve been taking this approach while working on my math libraries mr_tween and mr_geom over the past few days so that I can add a damped spring transform to my game. This sort of math typically takes me a while, but understanding how things actually work always seems to pay off in the long run.

Join my newsletter

Receive an email when I publish writing on game development.

You can unsubscribe at anytime.