All problems
Implicit Circle Slope
Problem
For the circle x^2 + y^2 = r^2, implicit differentiation gives dy/dx = -x / y.
Given the coordinates of a point on the circle, return the tangent slope. Return None when y is zero (the tangent is vertical).
Hint
Differentiate both sides with respect to x and solve for dy/dx.
Test cases
case 1
in: [1,1]
expected: -1
case 2
in: [2,0]
expected: null
case 3
in: [3,4]
expected: -0.75
Starter codePython
def implicit_circle_slope(x, y):
# Your code here
pass3 test cases · run your code against them in the editor