You will write three functions. One turns a centre and a radius into the coefficients of the general equation. One reads the centre and the radius from the general equation. One finds the circle through three points. The checker tests them on the circles of the lesson.
The idea. The circle has centre and radius . The centre and radius give , and . For three points, the centre lies on two perpendicular bisectors.
Your tasks.
general_form(h, k, r) to return (D, E, F).centre_radius(D, E, F) to return (h, k, r).through_three(p1, p2, p3) to return (h, k, r). Put the centre equal in distance from the three points. Subtracting the equations for two pairs of points gives two linear equations in h and k.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…