Vectors#
There are many ways to think about vectors; in computing, a vector is a list of numbers, and in physics, a vector is a quantity with both magnitude and direction. The position of something (say a particle, an atom, or a rocket) in two-dimensional space can be described as a vector. Three particles in space are shown in Fig. 3.
Fig. 3 Particles in some arbitrary space.#
These particles appear to be just floating in space, i.e., it is not possible to explain where they are. Typically, the positions of something is space are described with respect to some reference point, in this case, the origin position. The origin position is represented with the coordinates \((0, 0)\).
Fig. 4 The space is no longer arbitrary with the origin, \((0, 0)\), defined.#
Vectors can then be used to describe the positions of the particles with respect to the origin. These vectors, shown in Fig. 5 have a magnitude (the length of the arrow) and a direction (the way that the arrow is pointing). However, these properties of the vectors have no values yet.
Fig. 5 The vectors (yellow arrows) that describe the position of the particles with respect to the origin.#
The values of these properties are defined with basis vectors. Basis vectors describe the distances covered in the vector space where the particles exist.
Fig. 6 The basis vectors \(\mathbf{i}\) and \(\mathbf{j}\) shown.#
Using these basis vectors in Fig. 6, it can be said that the vectors have the following values
Alternatively, these can be written in mathematical matrix notation (as column vectors), where the top number is the number of steps in \(\mathbf{i}\) and the bottom number is the number of steps in \(\mathbf{j}\).
Fig. 7 The basis vectors outlining the particle vectors.#
Consider the notation in Eqn. (2), where the vectors are described as vertical arrays of numbers. This way of thinking about vectors can help us when we want to use NumPy arrays to codify these.