Usually when we use vectors in math/physics/game development we use them as a 3-scalar value ( for 3D ) where each represents a magnitude along each axis.

[source lang="cpp"]class Vector { float x, y, z; Vector(float _x,float _y, float _z);}[/source]

If we create a vector that has value Vector( 1, 0, 0 ) we are saying that this vector is 1 along the x axis and 0 along the y and z. You've probably noticed that this vector describes a position in 3-point space just as well as it does a direction and a magnitude. Which means if you have your position of an object stored as a Vector( x, y, z ) and you have the velocity stored as a Vector( x, y, z ) then you add the two vectors together with the equation

result = Vector( x1 + x2, y1 + y2, z1 + z2 )

You have now calculated the result of moving that position by the other vector's magnitude and direction.

But why a 3-scalar to describe direction and magnitude, rather than a series of angles and a magnitude value ?

Mostly for mathematical reasons. A 3 scalar of direction and magnitude is more powerful and easier to use than an angle + magnitude representation of the same value. A magnitude and direction from angles/magnitude can be calculated as:

result.x = cos( direction.x ) * magnitude - sin( direction.y ) * magnitude

result.y = sin( direction.x ) * magnitude + cos( direction.y ) * magnitude

I've tried writing more to this post. But the simple fact of the matter is that an introduction to vectors and linear geometry would end up being 10 pages long. Basically, don't use angles/magnitude to represent vectors. That is not what a vector is.

A vector has as many values as there are axis in the system, and each of those values corresponds to the magnitude of the vector along that axis. A vector is x, y, z where x represents magnitude of the vector along x-axis, y represents magnitude of the vector along y-axis and so on. 2D/3D/4D doesn't matter. Magnitude along an axis however is an internal magnitude. The concept of magnitude itself is a representation that is not of the internal components, but of the sum of their parts.

So where do direction and magnitude come from ? These are a description of the two basic properties that you can derive from that internal representation; direction and magnitude are not the components of a vector, they are properties of it.

The magnitude is obtained with

magnitude = sqrt ( x * x + y * y + z * z )

And the direction is obtained with

direction = Vector( x / magnitude, y / magnitude, z / magnitude )

Notice that the direction is also a vector. It's just a normalized vector. A directional vector has the property that it's magnitude is equal to one.

I'm not sure on what books are good for learning linear geometry. Which is what this is. I'm going to throw that out to the outfielder.

I say Code! You say Build! Code! Build! Code! Build! Can I get a woop-woop? Woop! Woop!