I'm an experienced programmer, but my higher-level math skills have always been weak. I've tried working through traditional math books, but I lose motivation when I can't see how the material applies. Are there any books, courses, or websites that teach trigonometry and more advanced topics—such as calculus or linear algebra—through practical programming projects?
4 Answers
You can connect trigonometry and calculus to a small game or simulation. For example, make a character jump along a gravity-based parabolic trajectory, then experiment with velocity, acceleration, and time steps. Programming can reinforce the math, although you’ll still need to learn the underlying concepts rather than expecting code alone to teach them.
Don’t overlook standard college-level calculus and linear algebra textbooks. A useful first project is writing your own vector and matrix library, then using it for a physics simulation. That gives you immediate reasons to understand the operations instead of just memorizing them.
A good way to make the math feel useful is to build basic computer graphics projects. Try implementing vectors, transformations, curves, z-buffering, antialiasing, or simple computer-vision algorithms such as homographies and edge detection. Those projects naturally give you a reason to learn the trigonometry and linear algebra behind them.
You might like From Mathematics to Generic Programming by Stepanov and Rose. It starts with fundamental math, explains where the formulas come from, and then turns the ideas into C++ algorithms. The examples are practical enough that they’re fairly easy to adapt to C or another language.

Hacker’s Delight is also worth checking out if you enjoy low-level programming. It focuses on mathematical tricks and algorithms involving integer and bit-level operations; despite the title, it isn’t about network security.