2

I am trying to plot a rotation about the x-axis of this cycloid function to show the volume of the surface of revolution.

This is what the curve looks like. Ignore the purple cirlce.

cycloid

The is the code I am using, I don't know how to get the sphere to show up.

\begin{tikzpicture}
        \begin{axis}[
            title=Revolution of one arch of cycloid,
            colormap/cool,
                    ]
            \addplot3[
                mesh,
                samples=50,
                domain=-8:8,
                    ]
            {-cos^3(t)+3cos^2(t)-3cos(t)+1};
\addlegendentry{$\pi \int_{0}^{2\pi} -cos^3(t)+3cos^2(t)-3cos(t)+1 dt$}
\end{axis}
\end{tikzpicture}

I know the formula should be $\int_{a}^{b} (y^2(t))*(x'(t))$ but I just get confused by the LaTeX syntax.

sampjr
  • 33

1 Answers1

1

Use the same technique that one transforms polar coordinate to cartesian coordinate.

\documentclass[border=9,tikz]{standalone}
\usetikzlibrary{3d}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}

\begin{document}

\begin{tikzpicture}[cap=round,join=round]
    \begin{axis}[axis equal,colormap/cool]
        \addplot3[surf,samples=40,domain=0:360,y domain=0:360,z buffer=sort]
            ({\x/57.29578-sin(\x)},{(1-cos(\x))*cos(\y)},{(1-cos(\x))*sin(\y)});
    \end{axis}
\end{tikzpicture}

\end{document}

Symbol 1
  • 36,855