Maths

A bit of maths

Sooner or later, drawing things on screen means doing a bit of maths. Here I’ll go through distances, lines, vectors and angles, with examples of where they come in handy. You don’t need to be a maths expert to get started.

Start with the distance formula, or pick a tutorial below.

What we’ll cover
Distances, lines and vectors
Angles and radians
Examples
Formulas explained
Uses in graphics and games
Before you start
Basic algebra
An idea of coordinates
Distance & linesVectors & dot productsAngles & radians

Tutorials

Work through them from the start, or jump straight to the bit you’re stuck on.

  • 1. Maths Distance Formula

    1. Maths Distance Formula

    The distance formula is one of the first things you learn once you get into maths. It is fundamental, especially when it comes to collision in computer games.

    Read tutorial →
  • 2. Maths Pythagoras Theorem

    2. Maths Pythagoras Theorem

    Pythagoras theorem is essential if you are doing anything that involves triangles. One of the building blocks of mathematics.

    Read tutorial →
  • 3. Maths Lines

    3. Maths Lines

    Lines, who doesn't love lines. They start at one point and end at another. In fact, lines are essential. What makes up a triangle? 3 lines. How do we draw a circle? A lot of lines. ...

    Read tutorial →
  • 4. Maths Vector Length

    4. Maths Vector Length

    Vectors are the back bone of 3D graphics, without them, the world of computer graphics would be a very messy place. And knowing the length of them often comes in handy, especially when looking at intersections ...

    Read tutorial →
  • 5. Maths Vector Dot Product

    The dot product is one of those elusive things that you aren't taught soon enough (In my opinion). If you want to do any lighting calculations yourself, then the dot product will be used extensively for ...

    Read tutorial →
  • 6. Maths Trigonometry

    6. Maths Trigonometry

    Trigonometry is one of those things that makes people run for the hills, but once you understand it, you won't know how you ever lived without it.

    Read tutorial →
  • 7. Maths Radians

    7. Maths Radians

    Radians are the hidden core behind trigonometry and can be a little tricky to understand at first. But once you get the hang of it, you will never want to go back to measuring angles in ...

    Read tutorial →

Before you start

A bit of algebra and an idea of how coordinates work will help. If you’re having trouble picturing a formula, try drawing it out on paper.

More tutorials

Now try putting some of this to use in OpenGL, building terrain or working with PhysX.