Lesson 15 of 18
Curvature
Curvature
Curvature measures how sharply a curve bends at a point. For :
ight)^{3/2}}$$ ### Intuition - **Straight line**: $f'' = 0$, so $kappa = 0$ (no bending) - **Circle of radius $R$**: $kappa = rac{1}{R}$ everywhere (constant curvature) - **Parabola** $y = x^2$ at $x=0$: tightest bend is at the vertex The **radius of curvature** is $R = rac{1}{kappa}$ — the radius of the osculating (best-fit) circle. ### Example: Parabola $y = x^2$ $$f'(x) = 2x, quad f''(x) = 2$$ $$kappa(x) = rac{2}{(1 + 4x^2)^{3/2}}$$ At $x=0$: $kappa = rac{2}{1} = 2$ (tightest) At $x=1$: $kappa = rac{2}{(1+4)^{3/2}} = rac{2}{5sqrt{5}} approx 0.1789$ (much gentler) As $x o infty$: $kappa o 0$ (nearly straight) ### Computing $(1+f'^2)^{3/2}$ Without `pow()`, use the identity $u^{3/2} = u cdot sqrt{u}$: ```c double u = 1.0 + fp * fp; double kappa = fpp_abs / (u * my_sqrt(u)); ``` ### Your Task Implement `double curvature(double (*f)(double), double x, double h)` using central differences for $f'$ and $f''$.TCC compiler loading...
Loading...
Click "Run" to execute your code.