All problems
Curvature of a Parabola
Problem
For the parabola y = a*x^2 + b*x, the curvature at the point x is |2*a| / (1 + (2*a*x + b)^2)^(3/2).
Given a, b, and x, return the curvature. A straight line with a = 0 has zero curvature everywhere.
Hint
Curvature decreases as the slope grows because the denominator is the speed cubed.
Test cases
case 1
in: [1,0,0]
expected: 2
case 2
in: [1,0,1]
expected: 0.17888543819998318
case 3
in: [0,5,3]
expected: 0
case 4
in: [2,1,0]
expected: 1.414213562373095
Starter codePython
def parabola_curvature(a, b, x):
# Your code here
pass4 test cases · run your code against them in the editor