Fortunada / Learn

Math for Programming

The math you already know can place an image, move a game character, shuffle a deck, store a color, or find a path through a maze. This course connects those familiar ideas to code, one lesson at a time.

13 lessons in two partsNo calculus neededCode samples in Godot 4

Why this path exists

Computer science often presents math as a wall of symbols. These lessons begin with a question instead: what does the program need to know? To draw a button, it needs a position and a size. To move a character, it needs a direction and a distance. To animate that movement, it needs to know how much time has passed. To shuffle a deck, find a path, or store a color, it needs a few more ideas, and nearly all of them grow out of math you meet in middle and high school.

You do not need calculus to begin. Each lesson starts from a familiar idea, shows what it does in a program, and only then adds vocabulary. Every page has a worked example, a short piece of Godot code, a hands-on demo, a common mistake to avoid, and a few questions with hidden answers.

Follow one object.

Imagine a small circle on a screen. In Part 1 we describe where it is, move it, turn it, give it a speed, aim it, check what it can see, and animate it smoothly. In Part 2 we look inside the computer: how its color is stored, how it takes turns with other objects, how it makes decisions, rolls dice, stays fast as the world grows, and finds its way around walls.

Part 1 · Space and motion

Geometry, algebra, and trigonometry for graphics and games.

1. Coordinates

Turn “over there” into a pair of numbers, and learn why screens count y downward.

2. Vectors

Describe a move with two numbers; measure it with Pythagoras; make diagonal movement fair.

4. Rates and motion

Use rates and elapsed time so motion looks the same on every computer. Add gravity.

6. The dot product

One number that tells whether something is ahead, behind, or beside you.

Part 2 · Math inside the computer

Number systems, logic, probability, and the math of algorithms.

Keep going

Practice set

Twenty mixed problems from every lesson, with answers hidden until you want them.

Glossary

Short, plain definitions of every term in the course, linked to its lesson.

Which lesson needs which school math?

If you know……you are ready for
The coordinate plane, ordered pairsCoordinates, Vectors
The Pythagorean theoremVectors, Dot product, Pathfinding
Geometric transformationsTransformations
Slope and rates, d = rtRates and motion, Interpolation
Right-triangle trigonometryAngles, Dot product
Place value and exponentsBinary, Growth
Long divisionRemainders
InequalitiesLogic
Basic probabilityRandomness

Need an algebra refresher first? Our sister site Algebravo has short video lessons and practice for pre-algebra and algebra. The source guide lists the books and documentation behind this path.