MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / collinear

Function collinear

code/geometry/primitives.cpp:18–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 return abs(p) == 0 ? point(0,0) : p / abs(p) * k; }
17double ccw(P(a), P(b), P(c)) { return cross(b - a, c - b); }
18bool collinear(P(a), P(b), P(c)) {
19 return abs(ccw(a, b, c)) < EPS; }
20double angle(P(a), P(b), P(c)) {
21 return acos(dot(b - a, c - b) / abs(b - a) / abs(c - b)); }
22double signed_angle(P(a), P(b), P(c)) {

Callers

nothing calls this directly

Calls 1

ccwFunction · 0.85

Tested by

no test coverage detected