simple geometry question- equation of cylinder

Solution 1:

If you really want an equation with z that support any cylinder position or rotation you can find it on another thread here :

$$(y−z)^2+(z−x)^2+(x−y)^2=3R^2$$

The link : Formula for cylinder

I searched it for while so I leave it here to help any other person searching for it !

Solution 2:

The equation of an object is a way of telling whether a point is part of an object -- if you substitute the coordinates of the point into the equation and the equation is true, then the point is on the object; if the equation is not true for that point, then the point is not on the object. There is no $z$ because the z-coordinate is not part of the decision of whether a point is on the cylinder.

The fact that there is no z tells you that all points where the x- and y-coordinates satisfy the equation are part of the cylinder, regardless of the value of z. For example, if the equation is $(x-1)^2 + (y+2)^2 = 4$, then one of the points on the cylinder is (1,0,0), but so is (1,0,1) and (1,0,-1) and (1,0,5) and (1,0, -789) and so on. This means that the cylinder goes on forever both up and down.