3

I want to find the equations for a solid oblique cylinder centered on the origin.

enter image description here

What's this equation?

Work I've Done So Far

Suppose the cylinder has radius $R$ and height $h$.

First, I found the equation for a regular solid cylinder centered on the origin.

$$\begin{align} x^2 + y^2 &\leq R^2 \\ -\frac{h}{2}\leq z &\leq \frac{h}{2} \end{align} $$

So then I tried to make a cylinder slanted.

enter image description here

And looking top down the cylinder moves

enter image description here

So, then I reasoned that I could just substitute these new values in. My equation for a solid oblique cylinder would be

$$\begin{align} (x-h\cos(\alpha))^2 + y^2 &\leq R^2 \\ 0\leq z &\leq h \sin(\alpha) \end{align} $$

But this is not centered on the origin. Using my diagram above, the center has $y=0$, and then the average of $(0,0)$ and $(2R + h\cos(\alpha),h\sin(\alpha)$. Then the center is

$$\mathbf{r}_{center}=\left(R + \frac{h}{2}\cos(\alpha),0,\frac{h}{2}\sin(\alpha)\right)$$

So the oblique cylinder centered on the COM is

$$\begin{align} \left(x-\left(R+\frac{h}{2}\cos(\alpha)\right)\right)^2 + y^2 &\leq R^2 \\ -\frac{h \sin(\alpha)}{2}\leq z &\leq \frac{h \sin(\alpha)}{2} \end{align} $$

But this also seems wrong to me because I think the $x$ coordinate of the center of a thin cross section of the cylinder should vary with height and my formula has no $z$.

So another possibility might be

$$\begin{align} \left(x-\left(\frac{z}{2}\cos(\alpha)\right)\right)^2 + y^2 &\leq R^2 \\ -\frac{h \sin(\alpha)}{2}\leq z &\leq \frac{h \sin(\alpha)}{2} \end{align} $$

This one seems reasonable because (1) the center of the circle would vary with height and (2) it reduces to the regular cylinder when $\alpha = 90^{\circ}$.

  • 1
    You're drawings are inconsistent. In the first, the edge of the bottom circle is at (0,0,0) and in the second, the center of the bottom circle is at (0,0,0) – Tbw Jul 28 '20 at 22:55
  • 1
    If the slant is in the $x z$ plane, then $$\begin{aligned} (x - z \sin\alpha)^2 + y^2 & \le R^2 \ \lvert z \rvert &\le \frac{h}{2} \end{aligned}$$perhaps? – None Jul 28 '20 at 23:21
  • Equation of what - volume? Surface? – Moti Jul 29 '20 at 00:52
  • @Moti the equation of the surface and any points contained within the surface – Stan Shunpike Jul 29 '20 at 13:40
  • @None Shouldn't the possible $z$ of the cylinder decrease as the angle gets steeper? Yours doesn't change – Stan Shunpike Jul 29 '20 at 13:42
  • @Tbw thank you! That is why I've been getting an error with a mysteriously appearing $R$ – Stan Shunpike Jul 29 '20 at 13:46
  • I assumed you measured the cylinder along the $z$ axis. If not, then$$ \lvert z \rvert \le \frac{h}{2} \cos\alpha$$. – None Jul 29 '20 at 13:47
  • If you want the top and bottom to be perpendicular to the axis of the cylinder, then you need to use an elliptic cylinder in rotated coordinates instead. – None Jul 29 '20 at 13:48
  • My suggestion above is not the correct answer, by the why. The correct answer should be $$\begin{aligned}(x + z\tan\alpha)^2 + y^2 &\le R^2 \ \lvert z \rvert &\le \frac{h}{2 \sqrt{1 + (\tan\alpha)^2}}\ \end{aligned}$$and I'd be happy to explain how and why, if it matches your requirements. Otherwise, I believe the underlying problem is a matter of definitions, not maths per se. – None Jul 29 '20 at 19:18
  • @None why have you used $\tan(\alpha)$ instead? – Stan Shunpike Jul 29 '20 at 19:57
  • I added my logic as an answer: $\tan$ is used because that's how you define a shear mapping. Consider angles larger than $45°$ to see why. Also, it turns out that $$\frac{h}{2\sqrt{1+(\tan\alpha)^2}} = \frac{h}{2}\cos(\alpha), \quad -90° \lt \alpha \lt +90°$$though, i.e. my two comments have the same rule for $z$, even though they look different. – None Jul 29 '20 at 23:33

5 Answers5

4

Ordinary Cylinder

An ordinary solid cylinder looks like this:

enter image description here

An the equations look like this

$$\begin{align} x^2 + y^2 \leq R^2 \\ |z| \leq \frac{h}{2} \end{align} $$

Oblique Cylinder

An oblique cylinder looks like this:

enter image description here

I will show how to derive the equations an oblique cylinder that is sheared in the $xz$ plane. Importantly, the height of the oblique cylinder should not change because that will change the volume. Therefore, the range of $z$ should remain the same.

A horizontal shear mapping is as follows:

$$\begin{bmatrix} x'\\ z'\\ \end{bmatrix} =\ \begin{bmatrix} 1 & m \\ 0 & 1\\ \end{bmatrix} \begin{bmatrix} x\\ z\\ \end{bmatrix} = \begin{bmatrix} x + mz\\ z \end{bmatrix} $$

This transformation can be seen using Python:

enter image description here

Notice the height between the bottom and top remains the same. This is the transformation we want. However, it is not stated in terms of $\alpha$, the angle from the vertical. It's stated in terms of the distance of the top point from the original spot, i.e. $m$ (see the picture above).

Now consider the following:

enter image description here

In this example, $\alpha_2 > \alpha_1$, so consequently, $cos(\alpha_2) < \cos(\alpha_1)$, which you can see in this side-by-side comparison.

enter image description here

Call the verticals for each triangle $A_1,A_2$, the horizontals $O_1,O_2$ and the hypotenuses $H_1$ and $H_2$.

Currently, $H_1 = H_2$ but we want $A_1 = A_2$. So we should normalize the adjacent sides to be the same length. This can be done as follows:

$$\begin{align} A^2 + O^2 & = H^2 \\ \frac{A^2}{A^2} + \frac{O^2}{A^2} &= \frac{H^2}{A^2} \\ 1 + \tan^2(\alpha) & = \sec^2(\alpha) \end{align} $$ which is the common trig identity. So if we set $m = \tan(\alpha)$, we end up getting this instead

enter image description here

Notice the heights are now the same, which means for different angles the height will be constant as desired. Thus, the transformation should be

$$\begin{bmatrix} x'\\ z'\\ \end{bmatrix} =\ \begin{bmatrix} 1 & \tan(\alpha) \\ 0 & 1\\ \end{bmatrix} \begin{bmatrix} x\\ z\\ \end{bmatrix} = \begin{bmatrix} x + z\tan(\alpha)\\ z \end{bmatrix} $$

So, the equation of the cylinder would be

$$\begin{align} (x-z\tan(\alpha))^2 + y^2 \leq R^2 \\ |z| \leq \frac{h}{2} \end{align} $$

This is the set of formulas Math Lover provided, so they were correct. However, I found their intuition for why $\tan$ was used lacking so I wanted to supplement.

Using $m=\sin$ vs $m=\tan$

In the comments, there was some discussion of whether $\sin$ or $\tan$ should be used for $m$. In this Python code, you can clearly see that $\sin$ wouldn't make sense.

enter image description here

See how even though $\alpha = 90^{\circ}$, $\sin(\alpha)$ doesn't stretch the cylinder waaaay out like we would expect.

However, notice for $\tan$, even at $\alpha = 85^\circ$, the stretch becomes very pronounced

enter image description here

Also, notice how the norm of the vertical sides for the $\tan$ output become enormous, which is also what you would expect, but it does not for the $\sin$ output.

This can also be seen in 3D here.

With $\sin$ at $\alpha = 90^\circ$,

enter image description here

Notice, this is the maximum possible slant and we can easily imagine a substantially more slanted cylinder.

With $\tan$ at $\alpha = 85^\circ$,

enter image description here

Why it is $x-z\tan(\alpha)$ not $x+z\tan(\alpha)$

If you use $x+z\tan(\alpha)$, that means the center of the top circle of the cylinder would be $x = -\frac{h}{2}\tan(\alpha)$, which is negative for $0\leq \alpha \leq 90^\circ$.

This would produce $$\begin{bmatrix} x'\\ z'\\ \end{bmatrix} =\ \begin{bmatrix} 1 & -\tan(\alpha) \\ 0 & 1\\ \end{bmatrix} \begin{bmatrix} x\\ z\\ \end{bmatrix} = \begin{bmatrix} x - z\tan(\alpha)\\ z \end{bmatrix} $$

and lead to the following cylinder

enter image description here

This is what None suggested and, as you can see, the cylinder here would be flipped from the desired cylinder with positive $x$ for positive $z$.

2

Equation of the right cylinder along z axis is

$x^2 + y^2 \le R^2$

between $-\frac{h}{2}\le z \le \frac{h}{2}$

Now you keep the point of the cylinder at the origin fixed and make it oblique along the x axis keeping both bases parallel to the XY plane,

(i) The x coordinate of the center will shift farther away from z axis as the value of |z| increases
(ii) The y coordinate of the center will remain the same.

The coordinate of the center at z will be $(z.tan\alpha, 0,z)$ where $\alpha$ is the angle between z-axis and axis of the cylinder.

The equation of the cylinder will be $(x-z.tan\alpha)^2 + y^2 \le R^2$.

If we want the oblique cylinder to have the same volume, $-\frac{h}{2}\le z \le \frac{h}{2}$ remains the same.

EDIT:

added pictures of initial position and oblique cylinder slanted towards x-axis.

enter image description here

enter image description here

Math Lover
  • 51,819
2

A right circular cylinder of radius $R$ and height $h$ centered at origin with cylinder axis on the $z$ axis fulfills $$\left\lbrace ~ \begin{aligned} x^2 + y^2 &\le R^2 \\ \lvert z \rvert &\le \frac{h}{2} \\ \end{aligned} \right . \tag{1}\label{None1}$$

If we want to apply a shear mapping to the $x z$ plane that slants the $x$ axis by angle $\varphi$ ($-90° \lt \varphi \lt +90°$), we perform a change in variables $$\left\lbrace ~ \begin{aligned} x^\prime &= x + z \tan\varphi \\ y^\prime &= y \\ z^\prime &= z \\ \end{aligned} \right . \tag{2}\label{None2}$$

If we have a line segment between $(0, 0, -s)$ and $(0, 0, +s)$ in the original coordinate system, with $0 \lt s \in \mathbb{R}$, the shear mapping would move its endpoints to $(-s \tan\varphi, 0, -s)$ and $(s \tan\varphi, 0, s)$, respectively. Therefore, its length would change from $2 s$ to $2\sqrt{(s \tan \varphi)^2 + s^2}$.

For the line segment to have a stretched length $h$, we need to solve $$h = 2 \sqrt{(s \tan\varphi)^2 + s^2} = 2 s \sqrt{1 + (\tan\varphi)^2} \tag{3a}\label{None3a}$$ for $s$. This is simple: $$s = \frac{h}{2 \sqrt{1 + (\tan\varphi)^2}} \tag{3b}\label{None3b}$$ However, because $$\frac{1}{\sqrt{1 + (\tan\varphi)^2}} = \cos\varphi \quad \text{ for} \quad -90° \lt \varphi \lt +90°$$ $\eqref{None3b}$ is actually equivalent to $$s = \frac{h}{2}\cos(\varphi) \tag{4}\label{None4}$$

Therefore, the equation for an oblique (shear-mapped) cylinder with $x$ axis sheared by angle $\varphi$ on the $xz$ plane, height along cylinder axis $h$, centered at origin, is $$\left\lbrace ~ \begin{aligned} (x - z \tan\varphi)^2 + y^2 &\le R^2 \\ \lvert z \rvert &\le \frac{h}{2} \cos\varphi \\ \end{aligned} \right. \tag{5}\label{None5}$$

None
  • 311
  • If $x' = x + z\tan(\varphi)$, shouldn't the circle centered on that new point be $(x-z\tan(\varphi))^2 + y^2 \leq R^2$? – Stan Shunpike Jul 30 '20 at 15:40
  • Also, I want the transformation to be volume preserving, so I think the height should remain the same or else the volume would change. Thus, I think the bounds on $z$ should not change or this wouldn't be satisfied. I was mistaken when I suggested they should before. – Stan Shunpike Jul 30 '20 at 15:42
  • 1
    @StanShunpike: Yes, that's a typo. Will fix. Why didn't you mention volume preserving in the first place? You only talked about height. Hrrumph. (It's okay, though; oftentimes finding the correct answer is mostly a matter of finding the right question to ask! :) ) – None Jul 30 '20 at 17:32
2

EDIT:

A particle is moving on an inclined axis of an oblique cylinder at speed V which has components $(x,z)$ axes as $$ ( V t\sin \alpha,V t \cos \alpha) ;$$

The horizontal cross section always remains the same starting circle centered at origin in its standard form parametrized as

$$ (x= R \cos u, y=R \sin u, x^2+y^2= R^2~)$$

but displaced/modified through above components:

enter image description here

Drawn for unit speed the oblique axis makes $30^{\circ}$ to vertical z direction.

Narasimham
  • 40,495
1

The equation of the original upright cylinder is

$ r^T Q r = r_0^2 $

where

$r = [x, y, z]^T $ and

$Q = \begin{bmatrix} 1 && 0 && 0 \\ 0 && 1 && 0 \\ 0 && 0 && 0 \end{bmatrix}$

and $r_0$ is the radius of the cylinder.

Now all you have to do is apply a sheer transformation to the points on this cylinder by an angle $\alpha$ measured from $z$ axis, and pointing in the positive $x$ axis, the sheer transformation matrix is given by:

$S = \begin{bmatrix} 1 && 0 && \tan \alpha \\ 0 && 1 && 0 \\ 0 && 0 && 1 \end{bmatrix} $

So that the image of $r $ is $r' = S r$, from which we can write $r = S^{-1} r'$

Substitute this into the equation of the upright cylinder, and remove the primes from the variable names ($r'$ to $ r$) you get

$ r^T S^{-T} Q S^{-1} r = r_0^2 $

And this is the equation of the oblique cylinder.

Hosam Hajeer
  • 21,978
  • what if the cylinder is tilted along y axis as well? how that will fit into the equation? – softy Dec 12 '21 at 14:36