In mathematics a **cylinder** is a quadric, i.e. a three-dimensional surface, with the following equation in Cartesian coordinates:

This equation is for an elliptic cylinder. If a = b then the surface is a *circular cylinder*. The cylinder is a *degenerate quadric* because at least one of the coordinates (in this case *z*) does not appear in the equation. By some definitions the cylinder is not considered to be a quadric at all.

In common usage, a *cylinder* is taken to mean a finite section of a right circular cylinder with its ends closed to form two circular surfaces, as in the figure (right). If the cylinder has a radius *r* and length *h*, then its volume is given by

*V* = π*r*^{2}*h*

and its surface area is

*A* = 2π*r*(*r* + *h*)

For a given volume, the cylinder with the smallest surface area has *h* = 2*r*. For a given surface area, the cylinder with the largest volume has *h* = 2*r*.

There are other more unusual types of cylinders. These are the *imaginary elliptic cylinders*:

the *hyperbolic cylinder*:

and the *parabolic cylinder*:

*x*^{2} + 2*y* = 0