Volume of a Cylinder

Calculates the volume of a cylinder as π × radius² × height.

A cylinder is a circle carried straight upwards. Its volume is the area of the base multiplied by the height, and since the base is a circle of radius rr, that area is πr2\pi r^2.

V=πr2hV = \pi r^2 h

Example

With the defaults, a radius of r=3r = 3 and a height of h=7h = 7. The base area is π×32=9π28.2743\pi \times 3^2 = 9\pi \approx 28.2743, so

V=9π×7=63π197.9203V = 9\pi \times 7 = 63\pi \approx 197.9203

The volume is about 197.9203.

Why base area times height

Imagine stacking thin discs, each a copy of the base, until the pile reaches the height hh. One disc covers πr2\pi r^2, and the stack is hh tall, so the volume is πr2h\pi r^2 h. The same argument works for any prism: volume equals base area times height.

Watch out

The height is measured perpendicular to the base. Enter the radius, not the diameter: a cylinder 6 across has radius 3. Doubling the radius makes the volume four times larger, whereas doubling the height only doubles it, because the radius enters squared. A cone with the same base and height holds exactly one third as much.