Skip to main content

Function: orientation2D()

orientation2D(o, a, b): number

Defined in: utils/vectors.ts:175

2D orientation predicate (signed twice-area of triangle o-a-b). Positive: counter-clockwise. Negative: clockwise. Zero: collinear.

Mathematically this is the z-component of the cross product of (a-o) and (b-o) — kept as its own helper because it is an orientation test, not a general vector operation.

Parameters

o

ArrayLike<number>

a

ArrayLike<number>

b

ArrayLike<number>

Returns

number