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

Function reflect

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

Source from the content-addressed store, hash-verified

9 P(about) = point(0,0)) {
10 return (p - about) * exp(point(0, radians)) + about; }
11point reflect(P(p), L(about1, about2)) {
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; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected