0 if outside, 1 if on circumference, 2 if inside circle
| 307 | } |
| 308 | // 0 if outside, 1 if on circumference, 2 if inside circle |
| 309 | int circle_line_relation(PT p, double r, PT a, PT b) { |
| 310 | double d = dist_from_point_to_line(a, b, p); |
| 311 | if (sign(d - r) < 0) return 2; |
| 312 | if (sign(d - r) == 0) return 1; |
| 313 | return 0; |
| 314 | } |
| 315 | //compute intersection of line through points a and b with |
| 316 | //circle centered at c with radius r > 0 |
| 317 | vector<PT> circle_line_intersection(PT c, double r, PT a, PT b) { |
nothing calls this directly
no test coverage detected