AlgoScope

Cross Product

The 2D cross product is twice the signed area of the triangle. Its sign is the turn direction.

Computational geometry, mathematics, intermediate
Cross product 22, left turn.ABC
Cross product 22, left turn.ABC

Plane Geometry: A left turn

Decision, step 2 of 3

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.

How plane geometry works

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.