3

There are some similar questions out there, but none that seemed to quite fit what I was looking for (that I saw).

I have a plane cutting through a right circular cone giving a circle (technically drawn as an ellipse). I am wanting to rotate both the plane and ellipse. However, when I do so the center of the ellipse shifts. The rotation seems to work for the plane (except it seems elongated on the right) and the ellipse rotates correctly, is there a way to fix the center coordinates of the ellipse?

Here is the original and the rotated:

\documentclass[border=10pt]{standalone}
\usepackage{amsmath}
\usepackage{tikz,pgfplots}     %for graphics
\pgfplotsset{compat = newest}     %to run newest version
\begin{document}
\pagestyle{empty}

\begin{tikzpicture}
        \draw [thick](-1,3) arc (180:360:2cm and 0.5cm) -- (1,0) -- cycle;
        \draw [thick](-1,3) arc (180:0:2cm and 0.5cm);
                
                \draw [thick](-1,-3) arc (180:360:2cm and 0.5cm) -- (1,0) -- cycle;
        \draw [thick](-1,-3) arc (180:0:2cm and 0.5cm);
                
                \draw [fill=gray!70,opacity=0.6,dashed](0,1.5) arc (180:-180:1cm and 0.25cm);
                
                \draw [fill=gray!50,opacity=0.4] (-1.5,2) -- (3.5,2) -- (3.1,1.1) -- (-1.9,1.1) -- (-1.5,2);
    \end{tikzpicture}

\begin{tikzpicture}
        \draw [thick](-1,3) arc (180:360:2cm and 0.5cm) -- (1,0) -- cycle;
        \draw [thick](-1,3) arc (180:0:2cm and 0.5cm);
                
                \draw [thick](-1,-3) arc (180:360:2cm and 0.5cm) -- (1,0) -- cycle;
        \draw [thick](-1,-3) arc (180:0:2cm and 0.5cm);
                
                \draw [rotate=-25,fill=gray!70,opacity=0.6,dashed](0,1.5) arc (180:-180:1cm and 0.25cm);
                
                \draw [rotate=-25,fill=gray!50,opacity=0.4] (-1.5,2) -- (3.5,2) -- (3.1,1.1) -- (-1.9,1.1) -- (-1.5,2);
    \end{tikzpicture}
\end{document}

1 Answer 1

3

TikZ rotate around (0,0) unless you use rotate around={degree:coordinate}. This will not really help you as you are not drawing in 3D. You can draw it in a 3D program or calculate the projection yourself. - \usepackage{tikz-3dplot} can help with that.

As your figure is an approximation in several ways, you might be happy with this empirical code:

\documentclass[tikz, border=1cm]{standalone}
\begin{document}

\begin{tikzpicture}
\draw[thick] 
(0,3)  ellipse[x radius=2, y radius=0.5]
(0,-3) ellipse[x radius=2, y radius=0.5]
(-2,-3) -- (2,3) (2,-3) -- (-2,3);
\draw[fill=gray!50, opacity=0.4] (-2.5,2) -- (2.5,2) -- (2.1,1.1) -- (-2.9,1.1) -- (-2.5,2);
\draw[fill=gray!70, opacity=0.6, dashed] (0,1.5) ellipse[x radius=1, y radius=0.25];
\end{tikzpicture}

\begin{tikzpicture}
\draw[thick] 
(0,3)  ellipse[x radius=2, y radius=0.5]
(0,-3) ellipse[x radius=2, y radius=0.5]
(-2,-3) -- (2,3) (2,-3) -- (-2,3);
\draw[rotate around={-25:(0,2.1)}, fill=gray!50, opacity=0.4] (-2.5,2) -- (2.5,2) -- (2.1,1.1) -- (-2.9,1.1) -- (-2.5,2);
\draw[rotate around={-25:(0,2.1)}, fill=gray!70, opacity=0.6, dashed] (0,1.5) ellipse[x radius=1.1, y radius=0.25];
\end{tikzpicture}

\end{document}

Two cones with cutting planes and ellipses

1
  • It looks like that will fix the problem I was having. I had manually moved the ellipse around before which was a very annoying process. Thank you
    – Gregory V.
    Dec 6, 2022 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .