You will build the circle from the two points that divide in the ratio , and then test it.
The idea. The internal division point is and the external one is , worked out one coordinate at a time. They are the ends of a diameter.
Your tasks.
divide(A, B, lam, outside). Return the internal point when outside is False, and the external one when it is True.apollonius(A, B, lam). Return (centre, radius) from the two division points.ratio_at(P, A, B). Return , using math.dist.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…