Solve a x^2 + bx + c = 0.
(a: float, b: float, c: float)
| 468 | |
| 469 | |
| 470 | def solve_quad(a: float, b: float, c: float) -> tuple[float, float]: |
| 471 | """Solve a x^2 + bx + c = 0.""" |
| 472 | a = 2 * a |
| 473 | d = b * b - 2 * a * c |
| 474 | if d < 0: |
| 475 | return None # the caller should expect this result. |
| 476 | |
| 477 | y = math.sqrt(d) |
| 478 | return (-b - y) / a, (-b + y) / a |
| 479 | |
| 480 | |
| 481 | def circle_circle_intersection(c1: Circle, c2: Circle) -> tuple[Point, Point]: |
no outgoing calls
no test coverage detected