A signed area in disguise
Most computational geometry rests on one tiny tool: the cross product of two vectors in the plane. Given three points, you form two vectors that share a common starting point and compute a single signed number from their coordinates. That number is twice the signed area of the triangle they span.
Reading the sign
The sign tells you how the points turn:
- A positive value means the three points make a left turn, also called counterclockwise.
- A negative value means a right turn, or clockwise.
- A zero value means the points are collinear, lying on one straight line.
This is the orientation test, and almost every hull, intersection, and polygon routine calls it.
Why it matters
Because the test is just multiplications and a subtraction, it avoids slow division and square roots. With integer inputs it stays exact, so you sidestep floating point error that would otherwise make borderline cases unreliable. You can chain orientation tests to walk around a shape and always know which way you are bending.
Key idea
The cross product of two edge vectors gives a signed area whose sign reveals left turn, right turn, or collinear in constant time.