You will write functions that compare the sides of two triangles, test for similarity by SSS, and find a height from a shadow.
Your tasks.
side_ratios, sort the sides of each triangle, and return the list of ratios y / x for the matching sides.is_similar, return True when all the ratios are equal, to within .height_from_shadow, return the height of an object from the pole's height and the two shadows. Then set tree to the height of a tree whose shadow is m, using a m pole with a m shadow.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…