You will write three functions for the loci of squared distances from two fixed points and . Points are pairs (x, y).
The idea. The rule is the circle about the midpoint with , when this is positive. The rule is the line , where .
Your tasks.
sq_dist(P, Q). Return the square of the distance .sum_circle(A, B, s). Return (centre, radius), or None when .diff_line(A, B, s). Return (a, b, c) for the line .Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…