Edit and compile if you like:
\documentclass{article}\usepackage{tikz}\usepackage{tikz-3dplot}\usetikzlibrary{math}\usepackage[active,tightpage]{preview}\PreviewEnvironment{tikzpicture}\setlength\PreviewBorder{1pt}%% File name: surface-of-revolution.tex% Description:% A geometric representation of a surface of revolution is shown.%% Date of creation: October, 17th, 2021.% Date of last modification: October, 9th, 2022.% Author: Efraín Soto Apolinar.% https://www.aprendematematicas.org.mx/author/efrain-soto-apolinar/instructing-courses/% Source: page 450 of the% Glosario Ilustrado de Matem\'aticas Escolares.% https://tinyurl.com/5udm2ufy%% Terms of use:% According to TikZ.net% https://creativecommons.org/licenses/by-nc-sa/4.0/% Your commitment to the terms of use is greatly appreciated.%\begin{document}%\tdplotsetmaincoords{60}{130}\begin{tikzpicture}[tdplot_main_coords]% The function that is rotated\tikzmath{function f(\x) {return 1.5 - 0.35*sin(\x r);};}\pgfmathsetmacro{\dominio}{2.0}\pgfmathsetmacro{\xi}{-\dominio}\pgfmathsetmacro{\step}{(\dominio-\xi)/70.0}\pgfmathsetmacro{\xs}{\xi+\step}\pgfmathsetmacro{\max}{3}% Circumferences (behind the coordiante axis)\foreach \x in {\xi,\xs,...,\dominio}{\pgfmathsetmacro{\radio}{f(\x)} % radius of the circumference of the solid of revolution\draw[cyan,very thick,opacity=0.35] plot[domain=0.5*pi:2.0*pi,smooth,variable=\t] ({\radio*cos(\t r)},{\x},{\radio*sin(\t r});}
Click to download: surface-of-revolution.tex • surface-of-revolution.pdf
Open in Overleaf: surface-of-revolution.tex
See more on the author page of Efraín Soto Apolinar.