官术网_书友最值得收藏!

Vector operations

Just like scalar information, vectors can also be added, subtracted and multiplied with each other. Suppose you have two vectors:  and  and  , with = (ax, ay, az) and  = (bx, by, bz). In this case, let us see how you will add and subtract these vectors with each other.

When adding the vectors, we add the components individually to give a new vector:

=   

= ((ax + bx) , (ay + by) , (az + bz ))

Let's now visualize the addition of two vectors in a graph as shown in the following image.

The Z value is kept as 0.0 for convenience:

Here, =(1.0, 0.4, 0.0 ) and  =(0.6, 2.0, 0.0)

So the resultant vector     = (1.0 + 0.6 , 0.4 + 2.0, 0.0 + 0.0)

                                                                      = (1.6, 2.4 , 0.0)

Vectors are also commutative meaning   +    will give the same result as  +  But if we add  to  then in the diagram above the dotted line will go from the tip of the blue arrow to the tip of the red arrow.

Furthermore, in vector subtraction, we subtract the individual components of the vectors to give a new vector:

 -  

= ((ax - bx) , (ay - by) , (az - bz ))

Now let's visualize the subtraction of 2 vectors in a graph as shown in the following image:

Here   = (1.0, 0.4, 0.0 ) and  = (0.6, 2.0, 0.0)

So the resultant vector   -  = (1.0 - 0.6, 0.4 - 2.0, 0.0 - 0.0)

                                                                               = (0.4, -1.6, 0.0)

If vectors A and B are equal, the result will be a zero vector with all three components being zero.

If  . This means ax = bx , ay = by , az = bz, then

 -  = (0, 0, 0)

We can multiply a scalar with a vector. The result is again a vector with each component of the vector multiplied by the scalar.

For example, if A is multiplied by a single value of s we will have the following result:

 =s  

 = s ×(ax, ay, az)

 = (s × ax, s × ay, s × az)

If  = (3, -5, 7) and s = 0.5 then  = s is

= (3 × 0.5, -5 × 0.5, 7 × 0.5)

= (1.5, -2.5. 3.5)

主站蜘蛛池模板: 孟连| 建德市| 无为县| 五家渠市| 龙陵县| 永福县| 甘洛县| 临海市| 和平区| 尼木县| 商水县| 伊吾县| 凤凰县| 舟山市| 宜都市| 巴林左旗| 大关县| 本溪| 乐清市| 广州市| 息烽县| 遵化市| 富裕县| 榆林市| 扬州市| 海南省| 克什克腾旗| 井研县| 呼和浩特市| 平果县| 荥经县| 眉山市| 嘉禾县| 上林县| 富蕴县| 白玉县| 息烽县| 莱芜市| 奉化市| 收藏| 武山县|