You will write functions that read the focus, the directrix and the latus rectum from , find the focal distance of a point and test whether a point is on the parabola. The checker uses the parabolas of the lesson.
The idea. For we have . The focus is , the directrix is , the latus rectum is and the focal distance of a point with abscissa is .
Your tasks.
parts(K) to return (a, focus_x, directrix_x, latus_rectum).focal_distance(K, x1) to return the focal distance of the point of the parabola with abscissa x1.on_parabola(K, x, y) to return True if the point is on the parabola. Compare with a small tolerance.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…