Lesson 13 of 18
Parametric Arc Length
Parametric Arc Length
A parametric curve is defined by two functions of a parameter :
The arc length is:
Why It Works
At parameter , the curve moves in and in . The Pythagorean theorem gives length .
Examples
Diagonal line on : , so
Line with slope on : , , so
Circle on :
Numerical Approach
for each midpoint t:
double xp = (x_fn(t+h) - x_fn(t-h)) / (2*h);
double yp = (y_fn(t+h) - y_fn(t-h)) / (2*h);
sum += my_sqrt(xp*xp + yp*yp);
Your Task
Implement double param_arc_length(double (*x_fn)(double), double (*y_fn)(double), double t0, double t1, int n, double h).
TCC compiler loading...
Loading...
Click "Run" to execute your code.