1

Say I have a line in 3D space with the equation: $$x=x_0+ta\\y=y_0+tb\\z=z_0+tc$$

I know that the euqation of a cylinder in 3D is: $$(y−z)^2+(z−x)^2+(x−y)^2=3r^2$$ from this post

However this cylinder is on the line: $x=y=z$

Is there any way to find the formula for a cylinder with its central axis on the line?

Vlad
  • 35

1 Answers1

1

The equation for a right circular cylinder of radius $r$, having an axis

$ A = P_0 + t a $

where $ a $ is a unit vector, is given by

$\boxed{ ( p - P_0)^T (I - {aa}^T ) (p - P_0) = r^2} $

where $p = [x, y, z]^T $

A special case of this equation is when $P_0 = (0,0,0)$ and $a = \dfrac{1}{\sqrt{3}}(1, 1, 1) $. In this case,

$ I - {aa}^T = \dfrac{1}{3} \begin{bmatrix} 2 && - 1 && - 1 \\ -1 && 2 && -1 \\ -1 && -1 && 2 \end{bmatrix}$

So that, the left hand side is

$ \dfrac{1}{3} ( 2 x^2 + 2 y^2 + 2 z^2 - 2 x y - 2 x z - 2 y z ) $

which can be factored as

$ \dfrac{1}{3} ( (x - y)^2 + (x - z)^2 + (y - z)^2 ) $

Hence, we get

$ (x - y)^2 + (x - z)^2 + (y - z)^2 = 3 r^2 $

Hosam Hajeer
  • 21,978
  • What is meant by the $I-aa^T$ in $( p - P_0)^T (I - {aa}^T ) (p - P_0) = r^2$ And wouldn't $aa^T$ be equal to $a^(T+1)$ – Vlad Oct 20 '23 at 08:34
  • $T$ means taking the transpose of a vector. So if $a = \begin{bmatrix} a_1 \ a_2 \ a_3 \end{bmatrix}$ then $a^T = \begin{bmatrix} a_1 && a_2 && a_3 \end{bmatrix} $ – Hosam Hajeer Oct 20 '23 at 08:43
  • The axis $a$ is represented by a column vector, so $a = \dfrac{1}{\sqrt{3}} (1, 1, 1) $ means $ a = \dfrac{1}{\sqrt{3}} \begin{bmatrix} 1 \ 1 \ 1 \end{bmatrix} $ – Hosam Hajeer Oct 21 '23 at 07:27
  • Then ${a a}^T = \dfrac{1}{3} \begin{bmatrix} 1 \ 1 \ 1 \end{bmatrix} \begin{bmatrix} 1 && 1 && 1 \end{bmatrix} = \dfrac{1}{3} \begin{bmatrix} 1 && 1 && 1 \ 1 && 1 && 1 \ 1 && 1 && 1 \end{bmatrix}$ – Hosam Hajeer Oct 21 '23 at 07:28
  • And finally, $I - {a a}^T = \begin{bmatrix} 1 && 0 && 0 \ 0 && 1 && 0 \ 0 && 0 && 1 \end{bmatrix} - \dfrac{1}{3} \begin{bmatrix} 1 && 1 && 1 \ 1 && 1 && 1 \ 1 && 1 && 1 \end{bmatrix} = \dfrac{1}{3} \begin{bmatrix} 2 && -1 && -1 \ -1 && 2 && -1 \ -1 && -1 && 2 \end{bmatrix} $ – Hosam Hajeer Oct 21 '23 at 07:30