{"id":49,"date":"2013-11-08T15:46:23","date_gmt":"2013-11-08T15:46:23","guid":{"rendered":"\/\/3dbym.ru\/2013\/11\/the-cross-or-vector-product\/"},"modified":"2013-11-08T15:46:23","modified_gmt":"2013-11-08T15:46:23","slug":"the-cross-or-vector-product","status":"publish","type":"post","link":"https:\/\/3dbym.ru\/2013\/11\/the-cross-or-vector-product\/","title":{"rendered":"The Cross (or Vector) Product"},"content":{"rendered":"
The cross product can also be useful. Calculating the cross product of two vectors yields a vector that is perpendicular to both of them. This can be used to find vectors that are normal, or perpendicular, to a surface. This is done often in 3D programming to calculate the light\u00ading normals. The normals used for lighting purposes are unit vectors that must be perpendicular to the surface that is being lit. The cross product comes in handy when trying to find these values.<\/p>\n
The cross product equation expands to the following: uxv = (y1z2-z1y2)i- (x1z2-z1x2)j+(x1y2-y1x2)k where i, j, and k are the vector components for the x, y, and z axes, respectively. As you noticed, it will not work on two\u00addimensional vectors, so three-dimensional vectors are used instead.<\/p>\n
Check out Figure 1.21 for an example.<\/p>\n
uxv (1,5,2) x (2,1,3)<\/p>\n
\n <\/p>\n<\/td>\n<\/tr>\n<\/table>\n (5 x 3 -2 x 1)\/’- (1 x 3-2 x 2)\/+ (1 x1 -5×2)k =<\/p>\n (13,1-9)<\/p>\n Figure 1.21 Calculating the cross product. The resultant vector will be orthogonal (perpendicular) to both of the vectors used in its calculation. You can verify this by taking the dot product of each of the vectors by the result. You will find you get a value of 0, meaning the vectors are orthogonal, both times.<\/p>\n","protected":false},"excerpt":{"rendered":" The cross product can also be useful. Calculating the cross product of two vectors yields a vector that is perpendicular to both of them. This can be used to find vectors that are normal, or perpendicular, to a surface. This is done often in 3D programming to calculate the light\u00ading normals. The normals used for […]<\/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\/49"}],"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=49"}],"version-history":[{"count":0,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"wp:attachment":[{"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3dbym.ru\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |