TITLE: Formula for cylinder
QUESTION [6 upvotes]: In an exercise I was asked to find a formula of the form $F(x,y,z)=C$ for a cylinder though the axis $(t,t,t)$ and radius $R$. The formula I got seemed a bit suspicious so I wanted to ask if I have it right.
Basically I used the vector formula for the distance between a line and a point found here: http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html. I chose $x_1=(0,0,0), x_2=(1,1,1)$ to determine the line. Marking $r=(x,y,z)$ for a point on the cylinder, after some simplification and moving things around in the equation, I got that each point on the cylinder needs to fulfill the formula:
$$(y-z)^2+(z-x)^2+(x-y)^2=3R^2$$
Have I correctly derived the formula?
Thanks a bunch!

REPLY [2 votes]: What you actually want here is the point-line distance formula for three dimensions. However, the cylinder equation you did get is correct. Using formula 10 in the link I gave, we have
$$r^2=\frac{\|\langle x,y,z\rangle\times(\langle x,y,z\rangle-\langle 1,1,1\rangle)\|^2}{1^2+1^2+1^2}=\frac{(z-y)^2+(x-z)^2+(y-x)^2}{1^2+1^2+1^2}$$
which rearranges to what you have.