{"id":48,"date":"2013-11-08T15:46:23","date_gmt":"2013-11-08T15:46:23","guid":{"rendered":"\/\/3dbym.ru\/2013\/11\/the-dot-or-scalar-product\/"},"modified":"2013-11-08T15:46:23","modified_gmt":"2013-11-08T15:46:23","slug":"the-dot-or-scalar-product","status":"publish","type":"post","link":"https:\/\/3dbym.ru\/2013\/11\/the-dot-or-scalar-product\/","title":{"rendered":"The Dot (or Scalar) Product"},"content":{"rendered":"
The dot product can be used to find the angle between two vectors and is a quick test to determine whether two vectors are orthogonal (at right angles to each other). This can be useful in 3D programming if you need to find the final direction and speed of an object that has wind, gravity, or other forces acting upon it. You would only need to know the direction and magnitude of the forces, and the direction the object would move without the extra force acting on it.<\/p>\n
Two vectors are orthogonal to each other if their dot product is zero. The dot product is defined in two ways. The first is uv = llull*llvll*cos0. The second way is uv = i1i2 + j1j2 … n1n2. All this means is that you multiply each of the vector components in the first vector by the corresponding component in the second vector, and then add all the results. The first equation (uv = llull*llvll*cos0) is used when you only know the magnitudes and angle between the two vectors, but may not<\/p>\n
<\/p>\n
know the actual values of each component. The second equation (uv = i1i2 + j1j2 … n1n2) is used when you do not know the angle between your two vectors, only the vector\u2019s components. So now how do you use those definitions to find the angle between your two vectors? Simple, you just call up your algebra and trig skills and solve the first equation for theta, which stands for the angle between the vectors. This is done for you in Figure 1.20. As always an example is shown as well.<\/p>\n
U* V = Ii\/llv1cos0<\/a><\/p>\n
\n \u0432 = arccos<\/p>\n<\/td>\n<\/tr>\n<\/table>\n \u041b\u0442\u043c\u041b<\/p>\n u\\v I<\/p>\n
|