Cross Product
The 2D cross product is twice the signed area of the triangle. Its sign is the turn direction.
Plane Geometry: A left turn
cross(AB, AC) = 5 x 5 - 1 x 3 = 22. Positive: C is to the left of the line through A and B, so the path turns left (counter-clockwise). The magnitude, 22, is twice the area of triangle ABC.
Cost
- Space
- O(1)
Before this
Leads to
Topics that need this one first.
Taught by the same lesson
Plane Geometry covers these too, in the same run.