0

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

  1. Is this the correct way to approach this problem? Are there simpler methods that can be used?
  2. What is the parameterized equation of an arbitrary cylinder in cylindrical coordinates?
  3. Methodology of finding the domain extents in cylindrical coordinates.
amWhy
  • 210,739
Signal11
  • 11
  • 1

1 Answers1

1

I stumbled on a solution.

Additional Constraint

First, an additional constraint in where the cylinder must not contain any point where $X,Y=[0,0]$. Otherwise there exists no solution for the minimum or maximum $theta$ and the minimum $r=0$. This condition would be true for any method used to determine the solution.

Solution

If we can project the arbitrary cylinder onto the $(X,Y)$ plane and create the bounding curves, we can use those to determine the bounds of the arbitrary cylinder in cylindrical coordinates.

This solution outlines how to determine the bounding curves of the cylinder: Projection of a cylinder from XYZ 3D space on to XY plane.

The boundary curves can be converted into cylindrical coordinates using the standard methodology, and any bracketed local minimum numerical method can be used to find the minimums and maximums of each of the curves from this point.

For the example above, this solution method provides the solution for the limits:

$ r = [0.80, 6.93] $

$ \theta = [-1.41, 0.76] $

This solution is different then I expected, but when I plot the results against the cylinder it looks correct: MatPlotLib Rendering of the Cylinder with the Bounding Curves

Since the intent is to determine if the arbitrary cylinder exists within a cylindrical grid, this method seems sufficient for my needs.

However, I am open to other methods that may be more robust or can solve the problem without the need for Numerical Methods.

Signal11
  • 11
  • 1
  • Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review – Red Five Dec 09 '24 at 23:51