Lesson 15 of 18
Volume of Revolution
Volume of Revolution
Rotating a curve around the x-axis sweeps out a solid. We can find its volume using the disk method.
Disk Method
At each , the cross-section is a disk with radius and area . Integrating these areas:
Washer Method
Rotating the region between two curves (outer) and (inner):
Each cross-section is a washer (disk with hole).
Classic Examples
Cylinder: rotate (constant) on :
Cone: rotate (line) on :
Sphere: rotate on :
Numerical Implementation
Use the midpoint rule:
#define PI 3.14159265358979
for each midpoint x:
sum += f(x) * f(x)
return PI * sum * h
Your Task
Implement double volume_disk(double (*f)(double), double a, double b, int n) that computes using the midpoint rule.
TCC compiler loading...
Loading...
Click "Run" to execute your code.