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

Function circumcircle

code/geometry/circles.cpp:39–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 assert(tangent(ip, A, rA, P.first, Q.first) == 2);
38 assert(tangent(ip, B, rB, P.second, Q.second) == 2); }
39pair<point,double> circumcircle(point a, point b, point c) {
40 b -= a, c -= a;
41 point p = perp(b*norm(c)-c*norm(b))/2.0/cross(b, c);
42 return make_pair(a+p,abs(p)); }
43// vim: cc=60 ts=2 sts=2 sw=2:

Callers 1

welzlFunction · 0.85

Calls 2

perpFunction · 0.85
crossFunction · 0.85

Tested by

no test coverage detected