AlgoScope

Dot Product

a . b = |a||b| cos theta. The sign tells whether vectors point the same way.

Computational geometry, mathematics, intermediate
Dot product with itself 25, with a perpendicular 0.AB
Dot product with itself 25, with a perpendicular 0.AB

Plane Geometry: Points, a vector and a distance

Step, step 3 of 4

Dot product: u . v = ux vx + uy vy = |u||v| cos(angle). With itself, (4, 3) . (4, 3) = 25, the squared length. With the perpendicular (3, -4) it is 4 x 3 + 3 x -4 = 0. Its sign says whether two vectors point the same way. Cross product: ux vy - uy vx = |u||v| sin(angle), zero for parallel vectors and signed by the turn direction.

Cost

Space
O(1)

Leads to

Topics that need this one first.

Taught by the same lesson

Plane Geometry covers these too, in the same run.