Lesson 4 of 18
Tangent Line
Tangent Line
The tangent line at a point is the line that just touches the curve there, with slope equal to .
Equation
This is the point-slope form of a line, using the derivative as the slope.
Linearization
The tangent line is also called the linear approximation (or linearization) of near :
This is the foundation of calculus-based approximation. It says: near any point, a smooth curve looks like a straight line.
Example
For at :
- Tangent line:
- At : (exact: , error = 1 — small for nearby )
Normal Line
The normal line is perpendicular to the tangent:
Your Task
Implement double tangent_y(double (*f)(double), double x0, double x, double h) that returns the y-value of the tangent line at , evaluated at . Use the central difference formula to compute .
TCC compiler loading...
Loading...
Click "Run" to execute your code.