More Description I'm trying to determine the domain extents of a cylinder with an arbitrary orientation and size in cylindrical coordinates. I need the domain extents, or the maximum and minimum values in r, $\theta$, z to determine the domain of a cylindrical grid that will be created later.
Problem Description
The arbitrary cylinder is defined by two points and a radius. The axis of the cylinder is along the unit vector defined by the two points. The two bounding points provided will always be in a Cartesian coordinate system with the same z-axis as the cylindrical coordinate system.
Example: For a cylinder defined by: $ Pt_1= \begin{bmatrix}2\\-2\\-3\end{bmatrix}, Pt_2=\begin{bmatrix}5\\2\\1\end{bmatrix}, r=2$, the domain extents in Cartesian are: $ x = \left[0.233, 6.767\right], y = \left[-3.562, 3.562\right], z = \left[-4.562, 2.562\right]$.
The domain extents in cylindrical are: $r \approx \left[1.4939, 6.926\right], \theta \approx \left[0.73, 4.78\right], z = \left[-4.5617, 2.5617\right].$
Work Done So Far: This problem can be solved in Cartesian using the circles that correspond to the end of the cylinder. The parametrized equations of a circle in three dimensions are shown here: Parametric Equation of a Circle in 3D Space?
$x\theta=\vec{c}_1 + r \cos(\theta) \vec{a}_1 + r \sin(\theta) \vec{b}_1\\y(\theta)=\vec{c}_2 + r \cos(\theta) \vec{a}_2 + r \sin(\theta) \vec{b}_2\\z(\theta)=\vec{c}_3 + r \cos(\theta) \vec{a}_3 + r \sin(\theta) \vec{b}_3,$ where $\vec{c}$ is either of the end points, $\vec{a}$ is defined such that the axial unit vector $\vec{v}$ and $\vec{a}$ satisfy $\vec{a} \cdot \vec{v}=0$, and $\vec{b} = \vec{a} \times \vec{v}$. This is all discussed in the link above.
With the parametrized equations for the edges of the cylinder in x, y, z, we can take the derivative of each equation with respect to $\theta$ and solve for when $\theta$ is zero. $\theta = n\pi | \vec{b}_i=0\\ \theta = 2n\pi-{2\tan}^{-1}\left(\frac{\vec{a}_i-\sqrt{\vec{a}_i^2+\vec{b}_i^2}}{\vec{b}_i}\right)|\vec{b}_i\ne0\\ \theta = 2n\pi-{2\tan}^{-1}\left(\frac{\vec{a}_i+\sqrt{\vec{a}_i^2+\vec{b}_i^2}}{\vec{b}_i}\right)|\vec{b}_i\ne0$, where $i$ is the index associated with the dimension.
However, with Cylindrical coordinates it can be shown that the domain extents are not fully defined by the two ends of the cylinder, thus requiring the parametrized solution of the entire surface defined in cylindrical coordinates. I haven't found a parameterized equation for an arbitrary cylinder in cylindrical coordinates, and I have been having difficulty deriving the equation for myself. In addition, even solving for the domain extents given by the edges of the cylinder has shown to be quite difficult.
Help Needed
- Is this the correct way to approach this problem? Are there simpler methods that can be used?
- What is the parameterized equation of an arbitrary cylinder in cylindrical coordinates?
- Methodology of finding the domain extents in cylindrical coordinates.