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

Function normalize

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

Source from the content-addressed store, hash-verified

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); }
18bool collinear(P(a), P(b), P(c)) {
19 return abs(ccw(a, b, c)) < EPS; }

Callers 6

intersectFunction · 0.85
tangentFunction · 0.85
tangent_outerFunction · 0.85
testFunction · 0.85
intxMethod · 0.85
initMethod · 0.85

Calls 1

pointClass · 0.70

Tested by 1

testFunction · 0.68