About the cylinder issue, I will recall (and fill the blanks in) an answer of Zorn here :
$$|\vec{x} - \vec{x}_1|^{2} = R^{2} + [(\vec{x} - \vec{x}_1)\bullet \vec{v}]^{2}\tag{1}$$
Indeed, to an infinite cylinder passing through point $M_1=(x_1,y_1,z_1)$, with axis defined by unit vector $\vec{v}=(a,b,c)$, and radius $R$, one can apply Pythagoras' theorem to the triangle with vertices $X=(x,y,z)$ (the generic point on the cylinder) and $X'$ (the orthogonal projection of $X$ onto the axis). We have
$$\begin{cases}XX'&=&R\\
\vec{M_1X}&=&(x-x_1,y-y_1,z-z_1)\\
M_1X'&=&\vec{M_1X} \bullet \vec{v}\end{cases}$$
The last equation only deserves an explanation : it is due to the fact that the length of the projection of a line segment $AB$ onto an axis with unit directing vector $\vec{v}$ is equal to the absolute value of the dot product $\vec{AB} \bullet \vec{v}$.
(1) can be written explicitly :
$$(x-x_1)^2+(y-y_1)^2+(z-z_1)^2=R^2+((x-x_1)a+(y-y_1)b+(z-z_1)c)^2\tag{2}$$
which is in fact a necessary and sufficient condition for a point $(x,y,z)$ to belong to the cylinder ; otherwise said, (2) is the equation of the cylinder.
Please note that (2) is a second degree expression, which is what one can expect. Indeed, a circular cylinder is a quadric, like the end-spheres. But together (cylinder + spheres) the capsule isn't a quadric and hasn't even an algebraic equation.
Remark : if $\vec{v}=(a,b,c)$ hasn't been normalized, its coordinates should be divided by $\sqrt{a^2+b^2+c^2}$ ; in a reciprocal way, one can write the equation of the cylinder in the case of an unnormalized directing vector under the (homogeneous and more symmetrical) form
$$((x-x_1)^2+(y-y_1)^2+(z-z_1)^2-R^2)(a^2+b^2+c^2)=((x-x_1)a+(y-y_1)b+(z-z_1)c)^2\tag{3}$$