Weather (state,county)

Notification


Fig. 6.4. The 3D vector has components Δx, Δy, Δz, which are the differences between the head and tail coordinates.

As 3D vectors play a very important part in computer animation, all future examples will be three-dimensional.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 6.2.1 Vector Manipulation As vectors are different from scalars, a set of rules has been developed to control how the two mathematical entities interact with one another. For instance, we need to consider vector addition, subtraction and multiplication, and how a vector can be modified by a scalar. Let’s begin with multiplying a vector by a scalar.
6.2.2 Multiplying a Vector by a Scalar Given a vector n, 2n means that the vector’s components are

doubled. For example, if which seems logical. Similarly, if we divide n by 2, its components are halved. Note that the vector’s direction remains unchanged – only its magnitude changes. It is meaningless to consider the addition of a scalar to a vector such as n+ 2, for it is not obvious which component of n is to be increased by 2. If all the components of n have to be increased by 2, then we simply add another vector whose components equal 2.
------------------------------------------------------------------------------------------------------------------------


6.2.3 Vector Addition and Subtraction
Given vectors r and s, r ± s is define as

Vector addition is commutative:

However, like scalar subtraction, vector subtraction is not commutative:

Let’s illustrate vector addition and subtraction with two examples. Figure 6.5 shows the graphical interpretation of adding two vectors r and s. Note that the tail of vector s is attached to the head of vector r. The resultant vector t = r + s is defined by adding the corresponding components of r and s together. Figure 6.6 shows a graphical interpretation for r − s. This time the components of vector s are reversed to produce an equal and opposite vector. Then it is attached to r and added as described above.

6.2.4 Position Vectors Given any point P(x, y, z ), a position vector p can be created by assuming that P is the vector’s head and the origin is its tail. Because the tail coordinates are (0, 0, 0) the vector’s components are x, y, z. Consequently, the vector’s magnitude ||p|| equals . For example, the point P(4, 5, 6) creates a position vector p relative to the origin:

We will see how position vectors are used in Chapter 8 when we consider analytical geometry. 6.2.5 Unit Vectors By definition, a unit vector has a magnitude of 1. A simple example is i where

Unit vectors are extremely useful when we come to vector multiplication. As we shall discover later, multiplication of vectors involves taking their magnitude, and if this is unity, the multiplication is greatly simplified. Furthermore, in computer graphics applications vectors are used to specify the orientation of surfaces, the direction of light sources and the virtual camera. Again, if these vectors have a unit length, the computation time associated with vector operations can be minimized. Converting a vector into a unit form is called normalizing and is achieved by dividing a vector’s components by its magnitude. To formalize this process, consider a vector r whose components are x, y, z. The magnitude ||r|| =

This process can be confirmed by showing that the magnitude of ru is 1:

To put this into context, consider the conversion of r into a unit form:

6.2.6 Cartesian Vectors Now that we have considered the scalar multiplication of vectors, vector addition and unit vectors, we can combine all three to permit the algebraic manipulation of vectors. To begin with, we will define three Cartesian unit vectors i, j, k that are aligned with the x -, y- and z -axes

respectively:
Therefore any vector aligned with the x-, y- or z -axes can be defined by a scalar multiple of the unit vectors i, j and k respectively. For example, a vector 10 6 Vectors 39 units long aligned with the x -axis is simply 10i, and a vector 20 units long aligned with the z -axis is 20k. By employing the rules of vector addition and subtraction, we can compose a vector r by adding three Cartesian vectors as follows Therefore any vector aligned with the x-, y- or z -axes can be defined by a scalar multiple of the unit vectors i, j and k respectively. For example, a vector 10 6 Vectors 39 units long aligned with the x -axis is simply 10i, and a vector 20 units long aligned with the z -axis is 20k. By employing the rules of vector addition and subtraction, we can compose a vector r by adding three Cartesian vectors as follows: r = ai + bj + ck (6.12)
This is equivalent to writing r as

which means that the magnitude of r is readily computed as

Any pair of Cartesian vectors such as r and s can be combined as follows:

For example, given

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6.2.7 Vector Multiplication :Although vector addition and subtraction are useful in resolving various problems, vector multiplication provides some powerful ways of computing angles and surface orientations. The multiplication of two scalars is very familiar: for example, 6×7 or 7× 6 = 42. We often visualize this operation, as a rectangular area where 6 and 7 are the dimensions of a rectangle’s sides, and 42 is the area. However, when we consider the multiplication of vectors we are basically multiplying two 3D lines together, which is not an easy operation to visualize. Mathematicians have discovered that there are two ways to multiply vectors together: one gives rise to a scalar result and the other a vector result. We will start with the scalar product.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6.2.8 Scalar Product We could multiply two vectors r and s by using the product of their magnitudes: ||r|| · ||s||. Although this is a valid operation, it does not get us anywhere because it ignores the orientation of the vectors, which is one of their important features. The concept, however, is readily
                                                        

No comments