Try dragging the points.
The dot product is a powerful vector operation and one of its most handy usage is to compute an angle between two lines.
The dot product in 2D
A·B = a1 * b1 + a2 * b2 = ||A|| * ||B|| * cos(θ)
- A and B are 2D vectors and A = [a1 a2], B = [b1, b2]
- ||A|| represents is the the magnitude of vector A
- θ is the angle between A and B
In the sample movie, the line AB represents the vector A and CD represents the vector B
sample movie and scripts



Leave a comment