Orientation predicate

ID: orientation-predicate

An orientation predicate determines on which side of an oriented geometric object a point lies. For planar points , compute the determinant
In coordinates with rightward and upward, means a counterclockwise turn from through to , a clockwise turn, and collinearity. Its magnitude is twice the area of the triangle.
For and , gives , while gives . Convex hull and segment-intersection algorithms use these signs to make discrete decisions. A tiny round-off error can reverse a nearly zero sign and make those decisions inconsistent. Jonathan Richard Shewchuk's adaptive arithmetic computes extra precision only when needed to certify the sign for the supplied coordinates.[ref]

New to topics? Read the docs here!