higherorderfun.com
Math for game programmers 02 – Vectors 101 | Higher-Order Fun
http://higherorderfun.com/blog/2009/06/07/math-for-game-programmers-02-vectors-101
Game Design and Game Programming. Math for game programmers 02 – Vectors 101. Motivation: The Ugly Code. Consider that you want to simulate some simple physics, such as an object accelerating in 3D space. We’re going to use the formulas Δs = v t a t and Δv = a t (where s is the position, v is the speed at the start, a is the acceleration, and t is the elapsed time). You might declare the object as something like this:. Enter vectors: The Pretty Code. Much shorter, isn’t it? How do they work? You’ll...