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

Function collinear

code/geometry/lines.cpp:2–3  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "primitives.cpp"
2bool collinear(L(a, b), L(p, q)) {
3 return abs(ccw(a, b, p)) < EPS && abs(ccw(a, b, q)) < EPS; }
4bool parallel(L(a, b), L(p, q)) {
5 return abs(cross(b - a, q - p)) < EPS; }
6point closest_point(L(a, b), P(c), bool segment = false) {

Callers 3

testFunction · 0.70
point_in_polygonFunction · 0.70
line_segment_intersectFunction · 0.70

Calls 1

ccwFunction · 0.85

Tested by 1

testFunction · 0.56