April 2003
Intermediate to advanced
576 pages
15h 13m
English
We shall now illustrate the very common operation of referring to successive entries in a list using vector components. Three-component vectors occur frequently in physics and engineering problems. In vector algebra, the scalar product of two vectors (also called the inner product, or the dot product) is the sum of products of corresponding components:
P = V • W = (vx × wx) + (vy × wy) + (vz × wz)
It makes sense to store the x-, y-, and z-components of each vector in adjacent information units. We will select word-length storage for components of two vectors, V and W , in our sample program (Figure 4-5), and the resulting scalar product, P, will be stored in a quad word.