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

Function circle_point_relation

Geometry/Geometry 2D.cpp:302–307  ·  view source on GitHub ↗

0 if outside, 1 if on circumference, 2 if inside circle

Source from the content-addressed store, hash-verified

300};
301//0 if outside, 1 if on circumference, 2 if inside circle
302int circle_point_relation(PT p, double r, PT b) {
303 double d = dist(p, b);
304 if (sign(d - r) < 0) return 2;
305 if (sign(d - r) == 0) return 1;
306 return 0;
307}
308// 0 if outside, 1 if on circumference, 2 if inside circle
309int circle_line_relation(PT p, double r, PT a, PT b) {
310 double d = dist_from_point_to_line(a, b, p);

Callers

nothing calls this directly

Calls 2

distFunction · 0.70
signFunction · 0.70

Tested by

no test coverage detected