CPKit
v1.6.1

Orientation

GeometryEasy

Verify Clockwise, Counter Clockwise, or Collinear relationships of three coordinates.

Alt+Shift+O

Orientation Interactive Grid (Drag A, B, or C)

A (-3, -2)B (1, 2)C (4, 1)
Determinant Cross Value:16
Resulting Orientation:Clockwise (CW)

Time Complexity

O(1) direct equations

Space Complexity

O(1) auxiliary
Conceptual Overview

Orientation of three ordered points in a 2D plane determines if they form a collinear line segment, a clockwise turn, or a counter-clockwise turn.

Mathematical Formula
val = (y_B - y_A)(x_C - x_B) - (x_B - x_A)(y_C - y_B) \\ \text{CW if } val > 0, \text{ CCW if } val < 0, \text{ Collinear if } val = 0
Source: CP-Algorithms geometry reference