{"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\n
\n

\u0432 = arccos<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

\u041b\u0442\u043c\u041b<\/p>\n

u\\v I<\/p>\n\n\n
\n

\"The<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n

<\/p>\n\n\n
\n

(<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n\n\n
\n

)<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n\n\n
\n

49.4\u00b0<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n\n\n
\n

\\^7×2’\/5<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n\n\n
\n

1 x 4 + 4 x 2<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n\n\n
\n

\u0432 = arccos<\/p>\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n<\/p>\n

<\/p>\n

Figure 1.20 Calculating the angle between two vectors, don\u2019t forget to use the second definition for the dot product. The first part shows the equation for the dot product solved for theta (the angle between the two vectors). Don\u2019t forget that ||v|| means the magnitude of v. The second part shows the calculations involved in calculating the angle between two vectors using the vectors <1,4> and <4,2>.<\/p>\n

<\/p>\n\n\n
\n<\/td>\n<\/tr>\n<\/table>\n

<\/p>\n

S\/1"<\/a><\/p>\n","protected":false},"excerpt":{"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, […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/posts\/48"}],"collection":[{"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":0,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}