You will find the centroid and the orthocentre of a triangle from its corners and its circumcentre, and then test the Euler line. Points are pairs (x, y).
The idea. The centroid is the average of the corners. With the circumcentre known, the orthocentre is , worked out one coordinate at a time. On the Euler line, .
Your tasks.
centroid(A, B, C). Return the point .orthocentre(A, B, C, O). Return .euler_ratio(O, G, H). 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…