Updated Dot Product.md (markdown)
commited
commit
1ef097d22dfbbd140b68b3aea1adca745b95542c
... | ... | @@ -1,7 +1,7 @@ |
1 | 1 | Dot product is algebraically defined as the sum of the product of the corresponding vector component. |
2 | 2 | |
3 | If we were to find the dot product of Vector A (Ax, Ay, Az) and Vector B (Bx, By, Bz), we would use this formula:\
|
|
4 | A•B = (Ax×Bx)+(Ay×By)+(Az×Bz) |
|
3 | If we were to find the dot product of Vector A (Ax, Ay, Az) and Vector B (Bx, By, Bz), we would use this formula: |
|
4 |
* A•B = (Ax×Bx)+(Ay×By)+(Az×Bz) |
|
5 | 5 | |
6 | 6 | [[/uploads/Dot Product.png]] |
7 | 7 | |
... | ... | @@ -21,4 +21,8 @@ We don't have an inverse cosine block, but we can create the script to find the |
21 | 21 | |
22 | 22 | Moving on to another example involving a stealth game, there is a guard facing a direction with a FOV of 90° (visually highlighted in green), and there is a ninja sneaking up on him. How can we check if the ninja is on the guard's sight? |
23 | 23 | |
24 | [[/uploads/Screenshot_20210106-131627_Fancade.jpg]] |
|
... | ... | \ No newline at end of file |
0 | [[/uploads/Screenshot_20210106-131627_Fancade.jpg]] |
|
1 | ||
2 | The first input for the dot product is the direction that the guard is facing, the second input is the vector from the guard's position to the ninja's. Then we compare the cosine of the angle formed by those two vector with the cosine of half of FOV: |
|
3 | ||
4 | [[/uploads/Screenshot_20210106-135840_Fancade.jpg]] |
|
... | ... | \ No newline at end of file |