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

Function proj

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

Source from the content-addressed store, hash-verified

12 point z = p - about1, w = about2 - about1;
13 return conj(z / w) * w + about1; }
14point proj(P(u), P(v)) { return dot(u, v) / dot(u, u) * u; }
15point normalize(P(p), double k = 1.0) {
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); }

Callers 2

intersectFunction · 0.85
testFunction · 0.85

Calls 1

dotFunction · 0.85

Tested by 1

testFunction · 0.68