You will write three functions that find the best place to stand in front of a statue, first by search and then by the formula. Heights are measured above the eye, in metres.
The idea. At the distance the statue makes the angle with . A computer can try many values of and keep the best one. The formula says the best is .
Your tasks.
view_angle(a, b, x). Return the angle at the eye, in degrees.best_by_search(a, b). Try x = 0.01, 0.02, ... up to 30 and return the x with the largest angle.best_by_formula(a, b). Return .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…