Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The direction of a vector is simply represented with an arrow, with the length of the arrow expressing the magnitude. The information to create a 2D vector can be easily recorded with just two numbers, which can be negative or positive.

a = ( 3, 6 )  

Diagram 2.   vector Vector a

 

The key thing to remember is that vectors represent direction and magnitude without a location. For this reason vectors are often combined with a coordinate. Confusingly, 2D and 3D coordinates are generally recorded in the same format as vectors, with just two numbers. However, coordinates are normally visually represented as points. 

Diagram 3.  vector Vector a, translated to point b (5,3)

...

b = ( 6, -3 )

a + b = (9, 3)

Diagram 4.  vector Vector addition

Subtraction

Subtracting two vectors

...

Multiplication only effects the magnitude of the vector, leaving the direction unchanged... However, if the vector is multiplied by a negative, then the direction is reversed! Multiplying vectors could be used to control the acceleration of space ship, to simulate wind resistance or drag. If an object in a game collides with wall, we may want to multiply the objects vector by -1, to reverse it's direction so that it bounces off the surface.

 

(Diagram 5.  vector Vector multiplication)

 

(Diagram 6.  vector Vector negative multiplication)

 


Normalising

A normalised vector has its magnitude set to one, with the direction left unchanged.

...