MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / get_circle

Function get_circle

Geometry/Geometry 2D.cpp:356–363  ·  view source on GitHub ↗

returns two circle c1, c2 through points a, b and of radius r 0 if there is no such circle, 1 if one circle, 2 if two circle

Source from the content-addressed store, hash-verified

354// returns two circle c1, c2 through points a, b and of radius r
355// 0 if there is no such circle, 1 if one circle, 2 if two circle
356int get_circle(PT a, PT b, double r, circle &c1, circle &c2) {
357 vector<PT> v = circle_circle_intersection(a, r, b, r);
358 int t = v.size();
359 if (!t) return 0;
360 c1.p = v[0], c1.r = r;
361 if (t == 2) c2.p = v[1], c2.r = r;
362 return t;
363}
364// returns two circle c1, c2 which is tangent to line u, goes through
365// point q and has radius r1; 0 for no circle, 1 if c1 = c2 , 2 if c1 != c2
366int get_circle(line u, PT q, double r1, circle &c1, circle &c2) {

Callers

nothing calls this directly

Calls 11

dist_from_point_to_lineFunction · 0.85
circle_line_intersectionFunction · 0.85
push_backMethod · 0.80
signFunction · 0.70
rotateccw90Function · 0.70
rotatecw90Function · 0.70
lineClass · 0.70
circleClass · 0.70
sizeMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected