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

Function progress

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

Source from the content-addressed store, hash-verified

24double angle(P(p)) { return atan2(imag(p), real(p)); }
25point perp(P(p)) { return point(-imag(p), real(p)); }
26double progress(P(p), L(a, b)) {
27 if (abs(real(a) - real(b)) < EPS)
28 return (imag(p) - imag(a)) / (imag(b) - imag(a));
29 else return (real(p) - real(a)) / (real(b) - real(a)); }
30// vim: cc=60 ts=2 sts=2 sw=2:

Callers 2

point_in_polygonFunction · 0.85
line_segment_intersectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected