You will write a function that names the conic given by the six numbers of , and a function that finds the -intercept of a tangent of a given slope. The checker uses the examples of the lesson.
The idea. Work out . If the equation is degenerate. Otherwise the sign of names the curve: negative for an ellipse (a circle if and ), zero for a parabola, positive for a hyperbola (rectangular if ).
Your tasks.
classify(a, h, b, g, f, c). Return one of the words "circle", "ellipse", "parabola", "hyperbola", "rectangular hyperbola" or "degenerate".tangent_c(kind, a, b, m). For kind = "ellipse" use and for kind = "hyperbola" use . Return the positive , or None if the number under the root is negative.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…